windows: Add thread ID in SuspendThread error warning message.
authorJoel Brobecker <brobecker@gnat.com>
Tue, 11 Jun 2013 10:20:11 +0000 (10:20 +0000)
committerJoel Brobecker <brobecker@gnat.com>
Tue, 11 Jun 2013 10:20:11 +0000 (10:20 +0000)
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.

gdb/ChangeLog
gdb/windows-nat.c

index 493da1d6bc2f04f73bae2e2b86e79b1424d4b4a7..2fb7ac8ff5fb46261f166727b7e31c0b18e23cc7 100644 (file)
@@ -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>
 
index 8320d27ae3e83f6b338b0e10ab00af8ba913a6d8..66c44eb7f316231b922bce75566eb74f0fb742dd 100644 (file)
@@ -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;