diff options
Diffstat (limited to 'gdb/cli/cli-interp.c')
-rw-r--r-- | gdb/cli/cli-interp.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/gdb/cli/cli-interp.c b/gdb/cli/cli-interp.c index d708a36..1069018 100644 --- a/gdb/cli/cli-interp.c +++ b/gdb/cli/cli-interp.c @@ -179,17 +179,22 @@ cli_interpreter_exec (void *data, const char *command_str) static struct gdb_exception safe_execute_command (struct ui_out *command_uiout, char *command, int from_tty) { - volatile struct gdb_exception e; + volatile struct gdb_exception exception; + struct gdb_exception e = exception_none; struct ui_out *saved_uiout; /* Save and override the global ``struct ui_out'' builder. */ saved_uiout = current_uiout; current_uiout = command_uiout; - TRY_CATCH (e, RETURN_MASK_ALL) + TRY_CATCH (exception, RETURN_MASK_ALL) { execute_command (command, from_tty); } + if (exception.reason < 0) + { + e = exception; + } /* Restore the global builder. */ current_uiout = saved_uiout; |