Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [PATCH] infun debug: Use correct target pid
@ 2019-03-25 16:18 Alan Hayward
  2019-03-25 16:22 ` Tom Tromey
  0 siblings, 1 reply; 4+ messages in thread
From: Alan Hayward @ 2019-03-25 16:18 UTC (permalink / raw)
  To: gdb-patches; +Cc: nd, Alan Hayward

The infrun debug reads the id for the exited thread from the ws value.
However, this is always 0, causing an assert in find_inferior_pid.

Instead, the id should be read from the wait return value.

This fixes a racy FAIL in gdb.threads/watchthreads-reorder.exp

gdb/ChangeLog:

2019-03-25  Alan Hayward  <alan.hayward@arm.com>

	* infrun.c (stop_all_threads): Fix debug print.
---
 gdb/infrun.c | 12 ++++--------
 1 file changed, 4 insertions(+), 8 deletions(-)

diff --git a/gdb/infrun.c b/gdb/infrun.c
index ad7892105a..5350ab73a1 100644
--- a/gdb/infrun.c
+++ b/gdb/infrun.c
@@ -4364,14 +4364,10 @@ stop_all_threads (void)
 		   || ws.kind == TARGET_WAITKIND_SIGNALLED)
 	    {
 	      if (debug_infrun)
-		{
-		  ptid_t ptid = ptid_t (ws.value.integer);
-
-		  fprintf_unfiltered (gdb_stdlog,
-				      "infrun: %s exited while "
-				      "stopping threads\n",
-				      target_pid_to_str (ptid).c_str ());
-		}
+		fprintf_unfiltered (gdb_stdlog,
+				    "infrun: %s exited while "
+				    "stopping threads\n",
+				    target_pid_to_str (event_ptid).c_str ());
 	    }
 	  else
 	    {
-- 
2.17.2 (Apple Git-113)


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2019-03-30 10:05 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-03-25 16:18 [PATCH] infun debug: Use correct target pid Alan Hayward
2019-03-25 16:22 ` Tom Tromey
2019-03-25 16:58   ` Alan Hayward
2019-03-30 10:05     ` Philippe Waroquiers

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox