From 63f06803320d4e116c402579694399540816b55f Mon Sep 17 00:00:00 2001 From: Daniel Jacobowitz Date: Fri, 17 Nov 2006 19:30:41 +0000 Subject: [PATCH] * utils.c (string_to_core_addr): Use error instead of internal_error. * mi/mi-main.c (mi_execute_command): Check for a NULL message. --- gdb/ChangeLog | 6 ++++++ gdb/mi/mi-main.c | 5 ++++- gdb/utils.c | 4 ++-- 3 files changed, 12 insertions(+), 3 deletions(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 6712d8c891b..1ecd3683c4b 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,9 @@ +2006-11-17 Daniel Jacobowitz + + * utils.c (string_to_core_addr): Use error instead of + internal_error. + * mi/mi-main.c (mi_execute_command): Check for a NULL message. + 2006-11-17 Daniel Jacobowitz * NEWS: Mention QPassSignals. diff --git a/gdb/mi/mi-main.c b/gdb/mi/mi-main.c index e2e084005c5..abb43f33241 100644 --- a/gdb/mi/mi-main.c +++ b/gdb/mi/mi-main.c @@ -1183,7 +1183,10 @@ mi_execute_command (char *cmd, int from_tty) somewhere. */ fputs_unfiltered (command->token, raw_stdout); fputs_unfiltered ("^error,msg=\"", raw_stdout); - fputstr_unfiltered (result.message, '"', raw_stdout); + if (result.message == NULL) + fputs_unfiltered ("unknown error", raw_stdout); + else + fputstr_unfiltered (result.message, '"', raw_stdout); fputs_unfiltered ("\"\n", raw_stdout); mi_out_rewind (uiout); } diff --git a/gdb/utils.c b/gdb/utils.c index c64629c5161..b33eadd1878 100644 --- a/gdb/utils.c +++ b/gdb/utils.c @@ -2865,7 +2865,7 @@ string_to_core_addr (const char *my_string) else if (isxdigit (my_string[i])) addr = (tolower (my_string[i]) - 'a' + 0xa) + (addr * 16); else - internal_error (__FILE__, __LINE__, _("invalid hex")); + error (_("invalid hex \"%s\""), my_string); } } else @@ -2877,7 +2877,7 @@ string_to_core_addr (const char *my_string) if (isdigit (my_string[i])) addr = (my_string[i] - '0') + (addr * 10); else - internal_error (__FILE__, __LINE__, _("invalid decimal")); + error (_("invalid decimal \"%s\""), my_string); } } return addr; -- 2.30.2