fbsd-nat: Add a low_new_fork virtual method.
authorJohn Baldwin <jhb@FreeBSD.org>
Tue, 22 Mar 2022 19:05:43 +0000 (12:05 -0700)
committerJohn Baldwin <jhb@FreeBSD.org>
Tue, 22 Mar 2022 19:05:43 +0000 (12:05 -0700)
This method can be overridden by architecture-specific targets to
perform additional work when a new child process is forked.

gdb/fbsd-nat.c
gdb/fbsd-nat.h

index ba84265dd58f5b94248bcc6b2badb6ddb31c2edd..6d76c8234d565ca60435e36588f9ffd3966e6f70 100644 (file)
@@ -1380,6 +1380,8 @@ fbsd_nat_target::wait_1 (ptid_t ptid, struct target_waitstatus *ourstatus,
                warning (_("Failed to fetch process information"));
 #endif
 
+             low_new_fork (wptid, child);
+
              if (is_vfork)
                ourstatus->set_vforked (child_ptid);
              else
index 2d9c6e19a2c752aefe7ff0d6217483ac5b411504..2f17be5a8f0a90113e8aafca7156d2fbe2f792b0 100644 (file)
@@ -109,6 +109,12 @@ public:
 
   bool supports_disable_randomization () override;
 
+  /* Methods meant to be overridden by arch-specific target
+     classes.  */
+
+  virtual void low_new_fork (ptid_t parent, pid_t child)
+  {}
+
 protected:
 
   void post_startup_inferior (ptid_t) override;