aboutsummaryrefslogtreecommitdiff
path: root/gdb/event-top.c
diff options
context:
space:
mode:
authorTom Tromey <tromey@adacore.com>2019-04-23 07:29:49 -0600
committerTom Tromey <tromey@adacore.com>2019-04-25 12:59:35 -0600
commitc6fdd8b2052baa9b7a27d4d34f109c9622b53509 (patch)
tree98fecba5793b6509802d1f653f4f5c8f46ee3463 /gdb/event-top.c
parentcc06b668978e542ecbc2aff1beca40e5baff86b0 (diff)
downloadgdb-c6fdd8b2052baa9b7a27d4d34f109c9622b53509.zip
gdb-c6fdd8b2052baa9b7a27d4d34f109c9622b53509.tar.gz
gdb-c6fdd8b2052baa9b7a27d4d34f109c9622b53509.tar.bz2
Make SJLJ exceptions more efficient
This changes the SJLJ exception handling code to be a bit more efficient, by using rvalue references and move assignment when possible. Tested by the buildbot. gdb/ChangeLog 2019-04-25 Tom Tromey <tromey@adacore.com> * event-top.c (gdb_rl_callback_read_char_wrapper_noexcept) (gdb_rl_callback_handler): Use std::move. * common/common-exceptions.h (struct gdb_exception): Add move assignment operator. (throw_exception_sjlj): Change "exception" to const reference. * common/common-exceptions.c (exceptions_state_mc_catch): Update. (throw_exception_sjlj): Change "exception" to const reference.
Diffstat (limited to 'gdb/event-top.c')
-rw-r--r--gdb/event-top.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/gdb/event-top.c b/gdb/event-top.c
index 959792d..bb8ba5c 100644
--- a/gdb/event-top.c
+++ b/gdb/event-top.c
@@ -178,7 +178,7 @@ gdb_rl_callback_read_char_wrapper_noexcept () noexcept
}
CATCH_SJLJ (ex, RETURN_MASK_ALL)
{
- gdb_expt = ex;
+ gdb_expt = std::move (ex);
}
END_CATCH_SJLJ
@@ -212,9 +212,9 @@ gdb_rl_callback_handler (char *rl) noexcept
{
ui->input_handler (gdb::unique_xmalloc_ptr<char> (rl));
}
- catch (const gdb_exception &ex)
+ catch (gdb_exception &ex)
{
- gdb_rl_expt = ex;
+ gdb_rl_expt = std::move (ex);
}
/* If we caught a GDB exception, longjmp out of the readline