diff options
author | Jan Kratochvil <jan.kratochvil@redhat.com> | 2013-03-22 20:39:29 +0000 |
---|---|---|
committer | Jan Kratochvil <jan.kratochvil@redhat.com> | 2013-03-22 20:39:29 +0000 |
commit | 598d363666e7b84f3dd5bf0f4cca83e856d77b1b (patch) | |
tree | b84520ff7a4a595be03345d69e882fc9504afceb /gdb/remote.c | |
parent | 82b821e99da6e5360fcb86adf8edf73fd463240c (diff) | |
download | gdb-598d363666e7b84f3dd5bf0f4cca83e856d77b1b.zip gdb-598d363666e7b84f3dd5bf0f4cca83e856d77b1b.tar.gz gdb-598d363666e7b84f3dd5bf0f4cca83e856d77b1b.tar.bz2 |
gdb/
* exceptions.h (enum errors): New entry TARGET_CLOSE_ERROR.
* remote.c (trace_error): Remove the special handling of '2'.
(readchar) <SERIAL_EOF>
(readchar) <SERIAL_ERROR>
(getpkt_or_notif_sane_1): Use TARGET_CLOSE_ERROR for them.
(remote_get_trace_status): Call throw_exception if EX is
TARGET_CLOSE_ERROR.
* utils.c (perror_with_name): Rename to ...
(throw_perror_with_name): ... here. New parameter errcode, describe it
in the function comment.
(perror_with_name): New function wrapper.
* utils.h (enum errors): New stub declaration.
(throw_perror_with_name): New declaration.
gdb/testsuite/
* gdb.server/server-kill.c: New file.
* gdb.server/server-kill.exp: New file.
Diffstat (limited to 'gdb/remote.c')
-rw-r--r-- | gdb/remote.c | 21 |
1 files changed, 13 insertions, 8 deletions
diff --git a/gdb/remote.c b/gdb/remote.c index f3206bc..c66618e 100644 --- a/gdb/remote.c +++ b/gdb/remote.c @@ -430,8 +430,6 @@ trace_error (char *buf) else error (_("remote.c: error in outgoing packet at field #%ld."), strtol (buf, NULL, 16)); - case '2': - error (_("trace API error 0x%s."), ++buf); default: error (_("Target returns error code '%s'."), buf); } @@ -7048,12 +7046,13 @@ readchar (int timeout) { case SERIAL_EOF: remote_unpush_target (); - error (_("Remote connection closed")); + throw_error (TARGET_CLOSE_ERROR, _("Remote connection closed")); /* no return */ case SERIAL_ERROR: remote_unpush_target (); - perror_with_name (_("Remote communication error. " - "Target disconnected.")); + throw_perror_with_name (TARGET_CLOSE_ERROR, + _("Remote communication error. " + "Target disconnected.")); /* no return */ case SERIAL_TIMEOUT: break; @@ -7576,7 +7575,9 @@ getpkt_or_notif_sane_1 (char **buf, long *sizeof_buf, int forever, { QUIT; remote_unpush_target (); - error (_("Watchdog timeout has expired. Target detached.")); + throw_error (TARGET_CLOSE_ERROR, + _("Watchdog timeout has expired. " + "Target detached.")); } if (remote_debug) fputs_filtered ("Timed out.\n", gdb_stdlog); @@ -10699,8 +10700,12 @@ remote_get_trace_status (struct trace_status *ts) } if (ex.reason < 0) { - exception_fprintf (gdb_stderr, ex, "qTStatus: "); - return -1; + if (ex.error != TARGET_CLOSE_ERROR) + { + exception_fprintf (gdb_stderr, ex, "qTStatus: "); + return -1; + } + throw_exception (ex); } /* If the remote target doesn't do tracing, flag it. */ |