diff options
author | Tom Tromey <tom@tromey.com> | 2022-04-30 14:20:53 -0600 |
---|---|---|
committer | Tom Tromey <tom@tromey.com> | 2022-05-06 12:03:34 -0600 |
commit | e02f53e50ebebfb8f020516a48d5581793748c6f (patch) | |
tree | 9e7321fd124166bac824f11921dddb109390d580 | |
parent | 4874f776caf053b708d7f76d6b72a8846f2ca219 (diff) | |
download | gdb-e02f53e50ebebfb8f020516a48d5581793748c6f.zip gdb-e02f53e50ebebfb8f020516a48d5581793748c6f.tar.gz gdb-e02f53e50ebebfb8f020516a48d5581793748c6f.tar.bz2 |
Add constructor to signal_catchpoint
This adds a constructor to signal_catchpoint and simplifies the
caller.
-rw-r--r-- | gdb/break-catch-sig.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/gdb/break-catch-sig.c b/gdb/break-catch-sig.c index c42b0fd..1c29a05 100644 --- a/gdb/break-catch-sig.c +++ b/gdb/break-catch-sig.c @@ -40,6 +40,12 @@ struct signal_catchpoint : public breakpoint { + signal_catchpoint (std::vector<gdb_signal> &&sigs, bool catch_all_) + : signals_to_be_caught (std::move (sigs)), + catch_all (catch_all_) + { + } + int insert_location (struct bp_location *) override; int remove_location (struct bp_location *, enum remove_bp_reason reason) override; @@ -316,10 +322,9 @@ create_signal_catchpoint (int tempflag, std::vector<gdb_signal> &&filter, { struct gdbarch *gdbarch = get_current_arch (); - std::unique_ptr<signal_catchpoint> c (new signal_catchpoint ()); + std::unique_ptr<signal_catchpoint> c + (new signal_catchpoint (std::move (filter), catch_all)); init_catchpoint (c.get (), gdbarch, tempflag, nullptr); - c->signals_to_be_caught = std::move (filter); - c->catch_all = catch_all; install_breakpoint (0, std::move (c), 1); } |