public inbox for gdb-cvs@sourceware.org
help / color / mirror / Atom feed
From: Tom Tromey <tromey@sourceware.org>
To: gdb-cvs@sourceware.org
Subject: [binutils-gdb] Add constructor to signal_catchpoint
Date: Fri,  6 May 2022 18:10:57 +0000 (GMT)	[thread overview]
Message-ID: <20220506181057.13E94394FC39@sourceware.org> (raw)

https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=e02f53e50ebebfb8f020516a48d5581793748c6f

commit e02f53e50ebebfb8f020516a48d5581793748c6f
Author: Tom Tromey <tom@tromey.com>
Date:   Sat Apr 30 14:20:53 2022 -0600

    Add constructor to signal_catchpoint
    
    This adds a constructor to signal_catchpoint and simplifies the
    caller.

Diff:
---
 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<gdb_signal> &&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<gdb_signal> &&filter,
 {
   struct gdbarch *gdbarch = get_current_arch ();
 
-  std::unique_ptr<signal_catchpoint> c (new signal_catchpoint ());
+  std::unique_ptr<signal_catchpoint> 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);
 }


                 reply	other threads:[~2022-05-06 18:10 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220506181057.13E94394FC39@sourceware.org \
    --to=tromey@sourceware.org \
    --cc=gdb-cvs@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).