From e02f53e50ebebfb8f020516a48d5581793748c6f Mon Sep 17 00:00:00 2001 From: Tom Tromey Date: Sat, 30 Apr 2022 14:20:53 -0600 Subject: [PATCH] Add constructor to signal_catchpoint This adds a constructor to signal_catchpoint and simplifies the caller. --- gdb/break-catch-sig.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/gdb/break-catch-sig.c b/gdb/break-catch-sig.c index c42b0fd1c01..1c29a057d60 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 &&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 &&filter, { struct gdbarch *gdbarch = get_current_arch (); - std::unique_ptr c (new signal_catchpoint ()); + std::unique_ptr 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); } -- 2.30.2