aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Baldwin <jhb@FreeBSD.org>2022-03-22 12:05:43 -0700
committerJohn Baldwin <jhb@FreeBSD.org>2022-03-22 12:05:43 -0700
commitc77282d8ba91cf25cf2f08b76702c447e2e74575 (patch)
tree3f996835a32b4ea67b67532d3ee51ff2999c47cc
parenta49ce729c808b5762faf948a34e6159a6d8874de (diff)
downloadbinutils-c77282d8ba91cf25cf2f08b76702c447e2e74575.zip
binutils-c77282d8ba91cf25cf2f08b76702c447e2e74575.tar.gz
binutils-c77282d8ba91cf25cf2f08b76702c447e2e74575.tar.bz2
fbsd-nat: Add a low_new_fork virtual method.
This method can be overridden by architecture-specific targets to perform additional work when a new child process is forked.
-rw-r--r--gdb/fbsd-nat.c2
-rw-r--r--gdb/fbsd-nat.h6
2 files changed, 8 insertions, 0 deletions
diff --git a/gdb/fbsd-nat.c b/gdb/fbsd-nat.c
index ba84265..6d76c82 100644
--- a/gdb/fbsd-nat.c
+++ b/gdb/fbsd-nat.c
@@ -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
diff --git a/gdb/fbsd-nat.h b/gdb/fbsd-nat.h
index 2d9c6e1..2f17be5 100644
--- a/gdb/fbsd-nat.h
+++ b/gdb/fbsd-nat.h
@@ -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;