Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Joel Brobecker <brobecker@adacore.com>
To: gdb-patches@sourceware.org
Subject: [commit/windows] Add thread ID in SuspendThread error warning message.
Date: Tue, 11 Jun 2013 10:22:00 -0000	[thread overview]
Message-ID: <1370946106-7883-1-git-send-email-brobecker@adacore.com> (raw)

From: brobecke <brobecke@metz.(none)>

Hello,

This patch adds the thread ID to a warning printed when a call to
SuspendThread fails. It will help investigate issues, particularly
when correlated with the various debug traces provided by the
windows-nat module.

For the record, the output has been changed from...

    warning: SuspendThread failed. (winerr 6)

... to ...

    warning: SuspendThread (tid=0x720) failed. (winerr 6)

gdb/ChangeLog:

        * window-nat.c (thread_rec): Add thread ID in SuspendThread
        warning message.

Tested on x86-windows, and checked in.

---
 gdb/ChangeLog     |    5 +++++
 gdb/windows-nat.c |    5 +++--
 2 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 493da1d..2fb7ac8 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,8 @@
+2013-06-11  Joel Brobecker  <brobecker@adacore.com>
+
+	* window-nat.c (thread_rec): Add thread ID in SuspendThread
+	warning message.
+
 2013-06-08  Pedro Alves  <pedro@codesourcery.com>
 	    Yao Qi  <yao@codesourcery.com>
 
diff --git a/gdb/windows-nat.c b/gdb/windows-nat.c
index 8320d27..66c44eb 100644
--- a/gdb/windows-nat.c
+++ b/gdb/windows-nat.c
@@ -311,8 +311,9 @@ thread_rec (DWORD id, int get_context)
 		if (SuspendThread (th->h) == (DWORD) -1)
 		  {
 		    DWORD err = GetLastError ();
-		    warning (_("SuspendThread failed. (winerr %u)"),
-			     (unsigned) err);
+		    warning (_("SuspendThread (tid=0x%x) failed."
+			       " (winerr %d)"),
+			     (unsigned) id, (unsigned) err);
 		    return NULL;
 		  }
 		th->suspended = 1;
-- 
1.7.10.4


             reply	other threads:[~2013-06-11 10:21 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-06-11 10:22 Joel Brobecker [this message]
2013-06-11 10:50 ` Pedro Alves
2013-06-11 11:07   ` Joel Brobecker
2013-06-11 13:25     ` Pedro Alves
2013-06-11 16:27 ` Eli Zaretskii
2013-06-11 16:38   ` Joel Brobecker
2013-06-11 17:40     ` Eli Zaretskii
2013-06-18 18:09       ` Christopher Faylor
2013-06-19  1:57         ` Joel Brobecker
2013-06-20 18:51           ` Christopher Faylor
2013-06-24 23:45             ` Joel Brobecker
2013-06-25 21:13               ` Christopher Faylor

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=1370946106-7883-1-git-send-email-brobecker@adacore.com \
    --to=brobecker@adacore.com \
    --cc=gdb-patches@sourceware.org \
    /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