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

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