Blame SOURCES/gdb-rhbz1854784-powerpc-remove-region-limit-dawr-1of7.patch

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