Blame SOURCES/gdb-follow-child-stale-parent.patch

6240d7
From FEDORA_PATCHES Mon Sep 17 00:00:00 2001
6240d7
From: Fedora GDB patches <invalid@email.com>
6240d7
Date: Fri, 27 Oct 2017 21:07:50 +0200
6240d7
Subject: gdb-follow-child-stale-parent.patch
6240d7
6240d7
;; Fix regression by python on ia64 due to stale current frame.
6240d7
;;=push+jan
6240d7
6240d7
Problem occurs with python and its get_current_arch () as it selects
6240d7
selected_frame and current_frame while still inferior_ptid is valid for the
6240d7
original parent.  But since this place it is already attached and later
6240d7
unwinders try to access it, breaking:
6240d7
  -PASS: gdb.threads/watchpoint-fork.exp: child: singlethreaded: breakpoint after the first fork
6240d7
  -PASS: gdb.threads/watchpoint-fork.exp: child: singlethreaded: watchpoint after the first fork
6240d7
  -PASS: gdb.threads/watchpoint-fork.exp: child: singlethreaded: breakpoint after the second fork
6240d7
  -PASS: gdb.threads/watchpoint-fork.exp: child: singlethreaded: watchpoint after the second fork
6240d7
  -PASS: gdb.threads/watchpoint-fork.exp: child: singlethreaded: finish
6240d7
  +FAIL: gdb.threads/watchpoint-fork.exp: child: singlethreaded: breakpoint after the first fork
6240d7
  +FAIL: gdb.threads/watchpoint-fork.exp: child: singlethreaded: watchpoint after the first fork
6240d7
  +FAIL: gdb.threads/watchpoint-fork.exp: child: singlethreaded: breakpoint after the second fork
6240d7
  +FAIL: gdb.threads/watchpoint-fork.exp: child: singlethreaded: watchpoint after the second fork
6240d7
  +FAIL: gdb.threads/watchpoint-fork.exp: child: singlethreaded: finish
6240d7
6240d7
diff --git a/gdb/infrun.c b/gdb/infrun.c
6240d7
--- a/gdb/infrun.c
6240d7
+++ b/gdb/infrun.c
6240d7
@@ -754,6 +754,9 @@ follow_fork (void)
6240d7
 	  }
6240d7
 	else
6240d7
 	  {
6240d7
+	    /* Possibly referenced PARENT is no longer valid.  */
6240d7
+	    reinit_frame_cache ();
6240d7
+
6240d7
 	    /* This pending follow fork event is now handled, one way
6240d7
 	       or another.  The previous selected thread may be gone
6240d7
 	       from the lists by now, but if it is still around, need