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

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