diff options
Diffstat (limited to 'gdb/cli')
-rw-r--r-- | gdb/cli/cli-interp.c | 9 | ||||
-rw-r--r-- | gdb/cli/cli-script.c | 7 |
2 files changed, 8 insertions, 8 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; diff --git a/gdb/cli/cli-script.c b/gdb/cli/cli-script.c index 010d661..2ec8bcd 100644 --- a/gdb/cli/cli-script.c +++ b/gdb/cli/cli-script.c @@ -1706,18 +1706,13 @@ script_from_file (FILE *stream, const char *file) { read_command_file (stream); } - switch (e.reason) + if (e.reason < 0) { - case 0: - break; - case RETURN_ERROR: /* Re-throw the error, but with the file name information prepended. */ throw_error (e.error, _("%s:%d: Error in sourced command file:\n%s"), source_file_name, source_line_number, e.message); - default: - internal_error (__FILE__, __LINE__, _("bad reason")); } } |