diff options
author | Tom Tromey <tom@tromey.com> | 2022-04-30 14:21:45 -0600 |
---|---|---|
committer | Tom Tromey <tom@tromey.com> | 2022-05-06 12:03:34 -0600 |
commit | 6c91c7de2007ca0d6f0285fa62e755507359a177 (patch) | |
tree | 7ace9405dd81133ad395ab32c4978f306f025949 | |
parent | e02f53e50ebebfb8f020516a48d5581793748c6f (diff) | |
download | binutils-6c91c7de2007ca0d6f0285fa62e755507359a177.zip binutils-6c91c7de2007ca0d6f0285fa62e755507359a177.tar.gz binutils-6c91c7de2007ca0d6f0285fa62e755507359a177.tar.bz2 |
Add constructor to syscall_catchpoint
This adds a constructor to syscall_catchpoint and simplifies the
caller.
-rw-r--r-- | gdb/break-catch-syscall.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/gdb/break-catch-syscall.c b/gdb/break-catch-syscall.c index bcdf0f1..d25d7ba 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<int> &&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<int> &&filter) { struct gdbarch *gdbarch = get_current_arch (); - std::unique_ptr<syscall_catchpoint> c (new syscall_catchpoint ()); + std::unique_ptr<syscall_catchpoint> 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); } |