From: Tom Tromey Date: Sat, 30 Apr 2022 20:20:53 +0000 (-0600) Subject: Add constructor to signal_catchpoint X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=e02f53e50ebebfb8f020516a48d5581793748c6f;p=binutils-gdb.git Add constructor to signal_catchpoint This adds a constructor to signal_catchpoint and simplifies the caller. --- 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); }