diff options
Diffstat (limited to 'gdb/exceptions.c')
-rw-r--r-- | gdb/exceptions.c | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/gdb/exceptions.c b/gdb/exceptions.c index 64a653a..623e8e0 100644 --- a/gdb/exceptions.c +++ b/gdb/exceptions.c @@ -174,7 +174,6 @@ catch_exceptions_with_msg (struct ui_out *func_uiout, char **gdberrmsg, return_mask mask) { - volatile struct gdb_exception ex; struct gdb_exception exception = exception_none; volatile int val = 0; struct ui_out *saved_uiout; @@ -183,14 +182,15 @@ catch_exceptions_with_msg (struct ui_out *func_uiout, saved_uiout = current_uiout; current_uiout = func_uiout; - TRY_CATCH (ex, RETURN_MASK_ALL) + TRY { val = (*func) (current_uiout, func_args); } - if (ex.reason < 0) + CATCH (ex, RETURN_MASK_ALL) { exception = ex; } + END_CATCH /* Restore the global builder. */ current_uiout = saved_uiout; @@ -228,17 +228,22 @@ int catch_errors (catch_errors_ftype *func, void *func_args, char *errstring, return_mask mask) { + struct gdb_exception exception = exception_none; volatile int val = 0; - volatile struct gdb_exception exception; struct ui_out *saved_uiout; /* Save the global ``struct ui_out'' builder. */ saved_uiout = current_uiout; - TRY_CATCH (exception, RETURN_MASK_ALL) + TRY { val = func (func_args); } + CATCH (ex, RETURN_MASK_ALL) + { + exception = ex; + } + END_CATCH /* Restore the global builder. */ current_uiout = saved_uiout; |