From e85e8e5effcfa1a1834fdbf899e167da6dccd2cd Mon Sep 17 00:00:00 2001 From: Mark Kettenis Date: Wed, 4 Mar 2015 14:22:42 +0100 Subject: [PATCH] Make "catch fork" work on systems with PT_GET_PROCESS_STATE These systems (OpenBSD and HP-UX 10.x) already support follow-fork including the events needed to for "catch fork". This just makes the upper layers realize this. gdb/ 2015-03-04 Mark Kettenis * inf-ptrace.c [PT_GET_PROCESS_STATE] (inf_ptrace_insert_fork_catchpoint): New function. (inf_ptrace_remove_fork_catchpoint): New function. (inf_ptrace_target) [PT_GET_PROCESS_STATE]: Install them. --- gdb/ChangeLog | 7 +++++++ gdb/inf-ptrace.c | 14 ++++++++++++++ 2 files changed, 21 insertions(+) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index ed9d355f964..621b73f58bd 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,10 @@ +2015-03-04 Mark Kettenis + + * inf-ptrace.c [PT_GET_PROCESS_STATE] + (inf_ptrace_insert_fork_catchpoint): New function. + (inf_ptrace_remove_fork_catchpoint): New function. + (inf_ptrace_target) [PT_GET_PROCESS_STATE]: Install them. + 2015-03-04 Andreas Arnez * s390-linux-tdep.c (s390_register_name): Return empty string diff --git a/gdb/inf-ptrace.c b/gdb/inf-ptrace.c index 3502a12e0b5..cd58dfb83ca 100644 --- a/gdb/inf-ptrace.c +++ b/gdb/inf-ptrace.c @@ -58,6 +58,18 @@ inf_ptrace_follow_fork (struct target_ops *ops, int follow_child, return 0; } +static int +inf_ptrace_insert_fork_catchpoint (struct target_ops *self, int pid) +{ + return 0; +} + +static int +inf_ptrace_remove_fork_catchpoint (struct target_ops *self, int pid) +{ + return 0; +} + #endif /* PT_GET_PROCESS_STATE */ @@ -666,6 +678,8 @@ inf_ptrace_target (void) t->to_create_inferior = inf_ptrace_create_inferior; #ifdef PT_GET_PROCESS_STATE t->to_follow_fork = inf_ptrace_follow_fork; + t->to_insert_fork_catchpoint = inf_ptrace_insert_fork_catchpoint; + t->to_remove_fork_catchpoint = inf_ptrace_remove_fork_catchpoint; t->to_post_startup_inferior = inf_ptrace_post_startup_inferior; t->to_post_attach = inf_ptrace_post_attach; #endif -- 2.30.2