summaryrefslogtreecommitdiff
path: root/gdb/utils.c
diff options
context:
space:
mode:
authorJan Kratochvil <jan.kratochvil@redhat.com>2013-03-22 20:39:28 +0000
committerJan Kratochvil <jan.kratochvil@redhat.com>2013-03-22 20:39:28 +0000
commit0da462514a01205302e1a34bd9cdfc7bec87b814 (patch)
treef4a1112a2ceac725da8c68f5321407a889d8c3e1 /gdb/utils.c
parenta92d1f522c964f92a465fda2a4af5a509def0312 (diff)
downloadgdb-0da462514a01205302e1a34bd9cdfc7bec87b814.tar.gz
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/utils.c')
-rw-r--r--gdb/utils.c16
1 files changed, 12 insertions, 4 deletions
diff --git a/gdb/utils.c b/gdb/utils.c
index a28c782ef94..a222c59ea18 100644
--- a/gdb/utils.c
+++ b/gdb/utils.c
@@ -966,11 +966,11 @@ add_internal_problem_command (struct internal_problem *problem)
}
/* Print the system error message for errno, and also mention STRING
- as the file name for which the error was encountered.
- Then return to command level. */
+ as the file name for which the error was encountered. Use ERRCODE
+ for the thrown exception. Then return to command level. */
void
-perror_with_name (const char *string)
+throw_perror_with_name (enum errors errcode, const char *string)
{
char *err;
char *combined;
@@ -987,7 +987,15 @@ perror_with_name (const char *string)
bfd_set_error (bfd_error_no_error);
errno = 0;
- error (_("%s."), combined);
+ throw_error (errcode, _("%s."), combined);
+}
+
+/* See throw_perror_with_name, ERRCODE defaults here to GENERIC_ERROR. */
+
+void
+perror_with_name (const char *string)
+{
+ throw_perror_with_name (GENERIC_ERROR, string);
}
/* Print the system error message for ERRCODE, and also mention STRING