public inbox for gdb-cvs@sourceware.org
help / color / mirror / Atom feed
* [binutils-gdb] Add constructor to signal_catchpoint
@ 2022-05-06 18:10 Tom Tromey
  0 siblings, 0 replies; only message in thread
From: Tom Tromey @ 2022-05-06 18:10 UTC (permalink / raw)
  To: gdb-cvs

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);
 }


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2022-05-06 18:10 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-05-06 18:10 [binutils-gdb] Add constructor to signal_catchpoint Tom Tromey

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).