blob: 74260afce1e471ce42c648bc98a32088d210cdef (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
|
commit 066ae99a326d77966288c59066018ca6f3f1d22d
Author: John Baldwin <jhb@FreeBSD.org>
Date: Tue Mar 22 12:05:43 2022 -0700
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.
(cherry picked from commit c77282d8ba91cf25cf2f08b76702c447e2e74575)
diff --git gdb/fbsd-nat.c gdb/fbsd-nat.c
index ba84265dd58..6d76c8234d5 100644
--- gdb/fbsd-nat.c
+++ 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 gdb/fbsd-nat.h gdb/fbsd-nat.h
index 2d9c6e19a2c..2f17be5a8f0 100644
--- gdb/fbsd-nat.h
+++ gdb/fbsd-nat.h
@@ -109,6 +109,12 @@ class fbsd_nat_target : public inf_ptrace_target
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;
|