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

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