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