summaryrefslogtreecommitdiff
path: root/gdb/remote.c
diff options
context:
space:
mode:
authorwrighton <wrighton>2012-09-12 20:01:10 +0000
committerwrighton <wrighton>2012-09-12 20:01:10 +0000
commite008c99bfba4df76fa99b175af4f5cf3acbf3f45 (patch)
tree2a01d526fae5ebf94f8559e2973c4c6f557cc493 /gdb/remote.c
parent47c1995754c5ed5017622f15a13ef8aa33cb58b7 (diff)
downloadgdb-e008c99bfba4df76fa99b175af4f5cf3acbf3f45.tar.gz
* gdb/remote.c (remote_insert_hw_breakpoint): Throw exception if
there is an error inserting hardware breakpoints and use the error message from the target. * gdb/breakpoint.c (insert_bp_location, insert_breakpoint_locations): Catch this exception and print the error message contained within. Do not print the default hardware error breakpoint message in this case.
Diffstat (limited to 'gdb/remote.c')
-rw-r--r--gdb/remote.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/gdb/remote.c b/gdb/remote.c
index 528f37435f5..a3309c7aacf 100644
--- a/gdb/remote.c
+++ b/gdb/remote.c
@@ -7026,6 +7026,7 @@ putpkt_binary (char *buf, int cnt)
int ch;
int tcount = 0;
char *p;
+ char *message;
/* Catch cases like trying to read memory or listing threads while
we're waiting for a stop reply. The remote server wouldn't be
@@ -8181,6 +8182,7 @@ remote_insert_hw_breakpoint (struct gdbarch *gdbarch,
CORE_ADDR addr;
struct remote_state *rs;
char *p, *endbuf;
+ char *message;
/* The length field should be set to the size of a breakpoint
instruction, even though we aren't inserting one ourselves. */
@@ -8215,6 +8217,13 @@ remote_insert_hw_breakpoint (struct gdbarch *gdbarch,
switch (packet_ok (rs->buf, &remote_protocol_packets[PACKET_Z1]))
{
case PACKET_ERROR:
+ if (rs->buf[1] == '.')
+ {
+ message = strchr (rs->buf + 2, '.');
+ if (message)
+ error ("Remote failure reply: %s", message + 1);
+ }
+ return -1;
case PACKET_UNKNOWN:
return -1;
case PACKET_OK: