Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Alan Hayward <Alan.Hayward@arm.com>
To: "gdb-patches@sourceware.org" <gdb-patches@sourceware.org>
Cc: nd <nd@arm.com>, Alan Hayward <Alan.Hayward@arm.com>
Subject: [PATCH] infun debug: Use correct target pid
Date: Mon, 25 Mar 2019 16:18:00 -0000	[thread overview]
Message-ID: <20190325161820.15406-1-alan.hayward@arm.com> (raw)

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)


             reply	other threads:[~2019-03-25 16:18 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-03-25 16:18 Alan Hayward [this message]
2019-03-25 16:22 ` Tom Tromey
2019-03-25 16:58   ` Alan Hayward
2019-03-30 10:05     ` Philippe Waroquiers

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190325161820.15406-1-alan.hayward@arm.com \
    --to=alan.hayward@arm.com \
    --cc=gdb-patches@sourceware.org \
    --cc=nd@arm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox