aboutsummaryrefslogtreecommitdiff
path: root/gdb/obsd-nat.h
diff options
context:
space:
mode:
authorJohn Baldwin <jhb@FreeBSD.org>2021-07-29 13:16:29 -0700
committerJohn Baldwin <jhb@FreeBSD.org>2021-07-29 14:13:16 -0700
commit42acc96479732c21d47fa0fb04e71e1eea5ee6d7 (patch)
treefc71e716eb6ed039c6a9caa29fe965747b7212f8 /gdb/obsd-nat.h
parent3d3f92f275a0599f00742fbfcfbd0fb5b0d58364 (diff)
downloadgdb-42acc96479732c21d47fa0fb04e71e1eea5ee6d7.zip
gdb-42acc96479732c21d47fa0fb04e71e1eea5ee6d7.tar.gz
gdb-42acc96479732c21d47fa0fb04e71e1eea5ee6d7.tar.bz2
obsd-nat: Various fixes for fork following.
- Don't use #ifdef's on ptrace ops. obsd-nat.h didn't include <sys/ptrace.h>, so the virtual methods weren't always overridden causing the fork following to not work. In addition, the thread and fork code is intertwined in ::wait and and the lack of #ifdef's there already assumed both were present. Finally, both of these ptrace ops have been present in OpenBSD for at least 10 years. - Move duplicated code to enable PTRACE_FORK event reporting to a single function and invoke it on new child processes reported via PTRACE_FORK. - Don't return early from PTRACE_FORK handling, but instead reset wptid to the correct ptid if the child reports its event before the parent. This allows the ptid fixup code to add thread IDs if the first event for a process is a PTRACE_FORK event. This also properly returns ptid's with thread IDs when reporting PTRACE_FORK events. - Handle detach_fork by skipping the PT_DETACH.
Diffstat (limited to 'gdb/obsd-nat.h')
-rw-r--r--gdb/obsd-nat.h2
1 files changed, 0 insertions, 2 deletions
diff --git a/gdb/obsd-nat.h b/gdb/obsd-nat.h
index ddd4baf..43a793e 100644
--- a/gdb/obsd-nat.h
+++ b/gdb/obsd-nat.h
@@ -29,7 +29,6 @@ class obsd_nat_target : public inf_ptrace_target
void update_thread_list () override;
ptid_t wait (ptid_t, struct target_waitstatus *, target_wait_flags) override;
-#ifdef PT_GET_PROCESS_STATE
void follow_fork (ptid_t, target_waitkind, bool, bool) override;
int insert_fork_catchpoint (int) override;
@@ -39,7 +38,6 @@ class obsd_nat_target : public inf_ptrace_target
void post_startup_inferior (ptid_t) override;
void post_attach (int) override;
-#endif
};
#endif /* obsd-nat.h */