/* Exception (throw catch) mechanism, for GDB, the GNU debugger.
- Copyright (C) 1986-2015 Free Software Foundation, Inc.
+ Copyright (C) 1986-2016 Free Software Foundation, Inc.
This file is part of GDB.
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;
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;
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;