aboutsummaryrefslogtreecommitdiff
path: root/gdb/exceptions.c
diff options
context:
space:
mode:
Diffstat (limited to 'gdb/exceptions.c')
-rw-r--r--gdb/exceptions.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/gdb/exceptions.c b/gdb/exceptions.c
index 0ca4c56..64a653a 100644
--- a/gdb/exceptions.c
+++ b/gdb/exceptions.c
@@ -174,7 +174,8 @@ catch_exceptions_with_msg (struct ui_out *func_uiout,
char **gdberrmsg,
return_mask mask)
{
- volatile struct gdb_exception exception;
+ volatile struct gdb_exception ex;
+ struct gdb_exception exception = exception_none;
volatile int val = 0;
struct ui_out *saved_uiout;
@@ -182,10 +183,14 @@ catch_exceptions_with_msg (struct ui_out *func_uiout,
saved_uiout = current_uiout;
current_uiout = func_uiout;
- TRY_CATCH (exception, RETURN_MASK_ALL)
+ TRY_CATCH (ex, RETURN_MASK_ALL)
{
val = (*func) (current_uiout, func_args);
}
+ if (ex.reason < 0)
+ {
+ exception = ex;
+ }
/* Restore the global builder. */
current_uiout = saved_uiout;