aboutsummaryrefslogtreecommitdiff
path: root/gdb/mi
diff options
context:
space:
mode:
Diffstat (limited to 'gdb/mi')
-rw-r--r--gdb/mi/mi-main.c12
-rw-r--r--gdb/mi/mi-parse.c3
2 files changed, 13 insertions, 2 deletions
diff --git a/gdb/mi/mi-main.c b/gdb/mi/mi-main.c
index 48c8d09..3a0e6a8 100644
--- a/gdb/mi/mi-main.c
+++ b/gdb/mi/mi-main.c
@@ -1818,6 +1818,7 @@ mi_cmd_list_features (char *command, char **argv, int argc)
ui_out_field_string (uiout, NULL, "ada-exceptions");
ui_out_field_string (uiout, NULL, "language-option");
ui_out_field_string (uiout, NULL, "info-gdb-mi-command");
+ ui_out_field_string (uiout, NULL, "undefined-command-error-code");
#if HAVE_PYTHON
if (gdb_python_initialized)
@@ -2023,7 +2024,16 @@ mi_print_exception (const char *token, struct gdb_exception exception)
fputs_unfiltered ("unknown error", raw_stdout);
else
fputstr_unfiltered (exception.message, '"', raw_stdout);
- fputs_unfiltered ("\"\n", raw_stdout);
+ fputs_unfiltered ("\"", raw_stdout);
+
+ switch (exception.error)
+ {
+ case UNDEFINED_COMMAND_ERROR:
+ fputs_unfiltered (",code=\"undefined-command\"", raw_stdout);
+ break;
+ }
+
+ fputs_unfiltered ("\n", raw_stdout);
}
void
diff --git a/gdb/mi/mi-parse.c b/gdb/mi/mi-parse.c
index a2634f1..a092759 100644
--- a/gdb/mi/mi-parse.c
+++ b/gdb/mi/mi-parse.c
@@ -285,7 +285,8 @@ mi_parse (const char *cmd, char **token)
/* Find the command in the MI table. */
parse->cmd = mi_lookup (parse->command);
if (parse->cmd == NULL)
- error (_("Undefined MI command: %s"), parse->command);
+ throw_error (UNDEFINED_COMMAND_ERROR,
+ _("Undefined MI command: %s"), parse->command);
/* Skip white space following the command. */
chp = skip_spaces_const (chp);