diff options
Diffstat (limited to 'gdb')
-rw-r--r-- | gdb/ChangeLog | 9 | ||||
-rw-r--r-- | gdb/event-top.c | 23 |
2 files changed, 27 insertions, 5 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 233a43c..5f0e6fe 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,12 @@ +2016-12-20 Pedro Alves <palves@redhat.com> + Yao Qi <yao.qi@linaro.org> + + PR gdb/20977 + * event-top.c (gdb_rl_callback_read_char_wrapper_noexcept): New + noexcept function, factored out from ... + (gdb_rl_callback_read_char_wrapper): ... this. + (gdb_rl_callback_handler): Mark noexcept. + 2016-12-20 Antoine Tremblay <antoine.tremblay@ericsson.com> * .dir-locals.el: Set c++ mode for the directory and set indent diff --git a/gdb/event-top.c b/gdb/event-top.c index acf8474..fa58def 100644 --- a/gdb/event-top.c +++ b/gdb/event-top.c @@ -157,10 +157,12 @@ void (*after_char_processing_hook) (void); sjlj-based TRY/CATCH mechanism, which knows to handle multiple levels of active setjmp/longjmp frames, needed in order to handle the readline callback recursing, as happens with e.g., secondary - prompts / queries, through gdb_readline_wrapper. */ + prompts / queries, through gdb_readline_wrapper. This must be + noexcept in order to avoid problems with mixing sjlj and + (sjlj-based) C++ exceptions. */ -static void -gdb_rl_callback_read_char_wrapper (gdb_client_data client_data) +static struct gdb_exception +gdb_rl_callback_read_char_wrapper_noexcept () noexcept { struct gdb_exception gdb_expt = exception_none; @@ -180,6 +182,15 @@ gdb_rl_callback_read_char_wrapper (gdb_client_data client_data) } END_CATCH_SJLJ + return gdb_expt; +} + +static void +gdb_rl_callback_read_char_wrapper (gdb_client_data client_data) +{ + struct gdb_exception gdb_expt + = gdb_rl_callback_read_char_wrapper_noexcept (); + /* Rethrow using the normal EH mechanism. */ if (gdb_expt.reason < 0) throw_exception (gdb_expt); @@ -187,10 +198,12 @@ gdb_rl_callback_read_char_wrapper (gdb_client_data client_data) /* GDB's readline callback handler. Calls the current INPUT_HANDLER, and propagates GDB exceptions/errors thrown from INPUT_HANDLER back - across readline. See gdb_rl_callback_read_char_wrapper. */ + across readline. See gdb_rl_callback_read_char_wrapper. This must + be noexcept in order to avoid problems with mixing sjlj and + (sjlj-based) C++ exceptions. */ static void -gdb_rl_callback_handler (char *rl) +gdb_rl_callback_handler (char *rl) noexcept { struct gdb_exception gdb_rl_expt = exception_none; struct ui *ui = current_ui; |