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

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