aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'gdb/mi/mi-main.c')
-rw-r--r--gdb/mi/mi-main.c5
1 files changed, 4 insertions, 1 deletions
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);
}