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

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