|
|
a909d0 |
From FEDORA_PATCHES Mon Sep 17 00:00:00 2001
|
|
|
a909d0 |
From: Pedro Franco de Carvalho <pedromfc@linux.ibm.com>
|
|
|
a909d0 |
Date: Wed, 7 Jul 2021 15:44:29 -0400
|
|
|
a909d0 |
Subject: gdb-rhbz1854784-powerpc-remove-region-limit-dawr-1of7.patch
|
|
|
a909d0 |
|
|
|
a909d0 |
;; Backport "Add low_new_clone method to linux_nat_target."
|
|
|
a909d0 |
;; (Pedro Franco de Carvalho, RH BZ 1854784)
|
|
|
a909d0 |
|
|
|
a909d0 |
This patch adds a low_new_clone method to linux_nat_target, called after
|
|
|
a909d0 |
a PTRACE_EVENT_CLONE is detected, similar to how low_new_fork is called
|
|
|
a909d0 |
after PTRACE_EVENT_(V)FORK.
|
|
|
a909d0 |
|
|
|
a909d0 |
This is useful for targets that need to copy state associated with a
|
|
|
a909d0 |
thread that is inherited across clones.
|
|
|
a909d0 |
|
|
|
a909d0 |
gdb/ChangeLog:
|
|
|
a909d0 |
2020-03-30 Pedro Franco de Carvalho <pedromfc@linux.ibm.com>
|
|
|
a909d0 |
|
|
|
a909d0 |
* linux-nat.h (low_new_clone): New method.
|
|
|
a909d0 |
* linux-nat.c (linux_handle_extended_wait): Call low_new_clone.
|
|
|
a909d0 |
|
|
|
a909d0 |
diff --git a/gdb/linux-nat.c b/gdb/linux-nat.c
|
|
|
a909d0 |
--- a/gdb/linux-nat.c
|
|
|
a909d0 |
+++ b/gdb/linux-nat.c
|
|
|
a909d0 |
@@ -2020,6 +2020,10 @@ linux_handle_extended_wait (struct lwp_info *lp, int status)
|
|
|
a909d0 |
inferior. */
|
|
|
a909d0 |
linux_target->low_new_fork (lp, new_pid);
|
|
|
a909d0 |
}
|
|
|
a909d0 |
+ else if (event == PTRACE_EVENT_CLONE)
|
|
|
a909d0 |
+ {
|
|
|
a909d0 |
+ linux_target->low_new_clone (lp, new_pid);
|
|
|
a909d0 |
+ }
|
|
|
a909d0 |
|
|
|
a909d0 |
if (event == PTRACE_EVENT_FORK
|
|
|
a909d0 |
&& linux_fork_checkpointing_p (lp->ptid.pid ()))
|
|
|
a909d0 |
diff --git a/gdb/linux-nat.h b/gdb/linux-nat.h
|
|
|
a909d0 |
--- a/gdb/linux-nat.h
|
|
|
a909d0 |
+++ b/gdb/linux-nat.h
|
|
|
a909d0 |
@@ -160,6 +160,10 @@ public:
|
|
|
a909d0 |
virtual void low_new_fork (struct lwp_info *parent, pid_t child_pid)
|
|
|
a909d0 |
{}
|
|
|
a909d0 |
|
|
|
a909d0 |
+ /* The method to call, if any, when a new clone event is detected. */
|
|
|
a909d0 |
+ virtual void low_new_clone (struct lwp_info *parent, pid_t child_lwp)
|
|
|
a909d0 |
+ {}
|
|
|
a909d0 |
+
|
|
|
a909d0 |
/* The method to call, if any, when a process is no longer
|
|
|
a909d0 |
attached. */
|
|
|
a909d0 |
virtual void low_forget_process (pid_t pid)
|