From: Tom Tromey Date: Sat, 30 Apr 2022 20:21:45 +0000 (-0600) Subject: Add constructor to syscall_catchpoint X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=6c91c7de2007ca0d6f0285fa62e755507359a177;p=binutils-gdb.git Add constructor to syscall_catchpoint This adds a constructor to syscall_catchpoint and simplifies the caller. --- diff --git a/gdb/break-catch-syscall.c b/gdb/break-catch-syscall.c index bcdf0f117a5..d25d7ba7c5e 100644 --- a/gdb/break-catch-syscall.c +++ b/gdb/break-catch-syscall.c @@ -37,6 +37,11 @@ struct syscall_catchpoint : public breakpoint { + explicit syscall_catchpoint (std::vector &&calls) + : syscalls_to_be_caught (std::move (calls)) + { + } + int insert_location (struct bp_location *) override; int remove_location (struct bp_location *, enum remove_bp_reason reason) override; @@ -347,9 +352,9 @@ create_syscall_event_catchpoint (int tempflag, std::vector &&filter) { struct gdbarch *gdbarch = get_current_arch (); - std::unique_ptr c (new syscall_catchpoint ()); + std::unique_ptr c + (new syscall_catchpoint (std::move (filter))); init_catchpoint (c.get (), gdbarch, tempflag, nullptr); - c->syscalls_to_be_caught = std::move (filter); install_breakpoint (0, std::move (c), 1); }