diff options
author | Mike Wrighton <wrighton@codesourcery.com> | 2012-09-12 20:01:10 +0000 |
---|---|---|
committer | Mike Wrighton <wrighton@codesourcery.com> | 2012-09-12 20:01:10 +0000 |
commit | dd61ec5cb3bcb866519cfce804693d5bc6a56b21 (patch) | |
tree | 370945c442ecc1cdcd71ba337393cd47ca876468 /gdb/remote.c | |
parent | a1b64ce14eb2871983290c5cddaaa565ccbb6749 (diff) | |
download | gdb-dd61ec5cb3bcb866519cfce804693d5bc6a56b21.zip gdb-dd61ec5cb3bcb866519cfce804693d5bc6a56b21.tar.gz gdb-dd61ec5cb3bcb866519cfce804693d5bc6a56b21.tar.bz2 |
* 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.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/gdb/remote.c b/gdb/remote.c index 528f374..a3309c7 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: |