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

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