aboutsummaryrefslogtreecommitdiff
path: root/gdb/linux-nat.c
diff options
context:
space:
mode:
authorPedro Franco de Carvalho <pedromfc@linux.ibm.com>2020-03-30 12:04:25 -0300
committerPedro Franco de Carvalho <pedromfc@linux.ibm.com>2020-03-30 12:06:43 -0300
commit1310c1b066d4a7b0ce48ad55103a8d559a37ace1 (patch)
treeecb82d3142a43fd0d0656f9b71c5c936279e1552 /gdb/linux-nat.c
parentc0502da6886e27f344375e471d6a7610a008c404 (diff)
downloadbinutils-1310c1b066d4a7b0ce48ad55103a8d559a37ace1.zip
binutils-1310c1b066d4a7b0ce48ad55103a8d559a37ace1.tar.gz
binutils-1310c1b066d4a7b0ce48ad55103a8d559a37ace1.tar.bz2
Add low_new_clone method to linux_nat_target.
This patch adds a low_new_clone method to linux_nat_target, called after a PTRACE_EVENT_CLONE is detected, similar to how low_new_fork is called after PTRACE_EVENT_(V)FORK. This is useful for targets that need to copy state associated with a thread that is inherited across clones. gdb/ChangeLog: 2020-03-30 Pedro Franco de Carvalho <pedromfc@linux.ibm.com> * linux-nat.h (low_new_clone): New method. * linux-nat.c (linux_handle_extended_wait): Call low_new_clone.
Diffstat (limited to 'gdb/linux-nat.c')
-rw-r--r--gdb/linux-nat.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/gdb/linux-nat.c b/gdb/linux-nat.c
index 133b87c..2849185 100644
--- a/gdb/linux-nat.c
+++ b/gdb/linux-nat.c
@@ -1978,6 +1978,10 @@ linux_handle_extended_wait (struct lwp_info *lp, int status)
inferior. */
linux_target->low_new_fork (lp, new_pid);
}
+ else if (event == PTRACE_EVENT_CLONE)
+ {
+ linux_target->low_new_clone (lp, new_pid);
+ }
if (event == PTRACE_EVENT_FORK
&& linux_fork_checkpointing_p (lp->ptid.pid ()))