From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2126) id 23014395200F; Fri, 6 May 2022 18:11:02 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 23014395200F Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable From: Tom Tromey To: gdb-cvs@sourceware.org Subject: [binutils-gdb] Add constructor to syscall_catchpoint X-Act-Checkin: binutils-gdb X-Git-Author: Tom Tromey X-Git-Refname: refs/heads/master X-Git-Oldrev: e02f53e50ebebfb8f020516a48d5581793748c6f X-Git-Newrev: 6c91c7de2007ca0d6f0285fa62e755507359a177 Message-Id: <20220506181102.23014395200F@sourceware.org> Date: Fri, 6 May 2022 18:11:02 +0000 (GMT) X-BeenThere: gdb-cvs@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-cvs mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 May 2022 18:11:02 -0000 https://sourceware.org/git/gitweb.cgi?p=3Dbinutils-gdb.git;h=3D6c91c7de2007= ca0d6f0285fa62e755507359a177 commit 6c91c7de2007ca0d6f0285fa62e755507359a177 Author: Tom Tromey Date: Sat Apr 30 14:21:45 2022 -0600 Add constructor to syscall_catchpoint =20 This adds a constructor to syscall_catchpoint and simplifies the caller. Diff: --- gdb/break-catch-syscall.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) 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 @@ =20 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::vec= tor &&filter) { struct gdbarch *gdbarch =3D get_current_arch (); =20 - 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 =3D std::move (filter); =20 install_breakpoint (0, std::move (c), 1); }