[3/3] Windows gdb: Document "info threads" Windows specifics

Message ID 20260504173344.1278735-4-pedro@palves.net
State New
Headers
Series Show CONTEXT_EXCEPTION_REQUEST info in "info threads" |

Commit Message

Pedro Alves May 4, 2026, 5:33 p.m. UTC
  Document "info threads" Windows specifics in the Windows debugging
features section.

Change-Id: I2123899bb8482381657ffbb4f0cc99f196526623
commit-id:856225ce
---
 gdb/doc/gdb.texinfo | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)
  

Comments

Eli Zaretskii May 4, 2026, 7:14 p.m. UTC | #1
> From: Pedro Alves <pedro@palves.net>
> Date: Mon,  4 May 2026 18:33:42 +0100
> 
> Document "info threads" Windows specifics in the Windows debugging
> features section.
> 
> Change-Id: I2123899bb8482381657ffbb4f0cc99f196526623
> commit-id:856225ce
> ---
>  gdb/doc/gdb.texinfo | 17 +++++++++++++++++
>  1 file changed, 17 insertions(+)

Thanks.

> +@smallexample
> +(@value{GDBP}) info threads
> +  Id   Target Id                            Frame
> +  1    Thread 15648.0x4338                  main () at example.c:5
> +  2    Thread 15648.0x3d58 (in syscall)     0x00007ffde37057b4 in ntdll!ZwWaitForWorkViaWorkerFactory () from C:/WINDOWS/SYSTEM32/ntdll.dll
> +* 3    Thread 15648.0x12d4 (in exception)   0x00007ffde00aa464 in KERNELBASE!CtrlRoutine () from C:/WINDOWS/System32/KERNELBASE.dll
> +@end smallexample

Aren't these lines too long even for @smallexample?  Did you try
generating PDF, and if so, did you get "overlong" warnings from TeX?

Otherwise, this is okay.

Reviewed-By: Eli Zaretskii <eliz@gnu.org>
  
Pedro Alves May 7, 2026, 5:59 p.m. UTC | #2
Hi Eli,

On 2026-05-04 20:14, Eli Zaretskii wrote:
>> From: Pedro Alves <pedro@palves.net>
>> +@smallexample
>> +(@value{GDBP}) info threads
>> +  Id   Target Id                            Frame
>> +  1    Thread 15648.0x4338                  main () at example.c:5
>> +  2    Thread 15648.0x3d58 (in syscall)     0x00007ffde37057b4 in ntdll!ZwWaitForWorkViaWorkerFactory () from C:/WINDOWS/SYSTEM32/ntdll.dll
>> +* 3    Thread 15648.0x12d4 (in exception)   0x00007ffde00aa464 in KERNELBASE!CtrlRoutine () from C:/WINDOWS/System32/KERNELBASE.dll
>> +@end smallexample
> 
> Aren't these lines too long even for @smallexample?  Did you try
> generating PDF, and if so, did you get "overlong" warnings from TeX?

Indeed, I hadn't looked at the PDF.  I don't get "overlong" warnings, but the
example does not fit on a PDF page, and is cut on the right hand side.

I'd now trimmed as much as I could and wrapped the text in the "Frame" column.

Let me know if this looks OK to you this way.

> 
> Otherwise, this is okay.
> 
> Reviewed-By: Eli Zaretskii <eliz@gnu.org>
> 

From 8855c2fee69ce081cfc5efd3b5b8556a2b3a1317 Mon Sep 17 00:00:00 2001
From: Pedro Alves <pedro@palves.net>
Date: Mon, 4 May 2026 17:58:49 +0100
Subject: [PATCH 3/3] Windows gdb: Document "info threads" Windows specifics

Document "info threads" Windows specifics in the Windows debugging
features section.

Change-Id: I2123899bb8482381657ffbb4f0cc99f196526623
commit-id: 856225ce
---
 gdb/doc/gdb.texinfo | 21 +++++++++++++++++++++
 1 file changed, 21 insertions(+)

diff --git a/gdb/doc/gdb.texinfo b/gdb/doc/gdb.texinfo
index f132b8fee21..90f142335c3 100644
--- a/gdb/doc/gdb.texinfo
+++ b/gdb/doc/gdb.texinfo
@@ -25908,6 +25908,27 @@ supports @kbd{C-@key{BREAK}} as an alternative interrupt key
 sequence, which can be used to interrupt the debuggee even if it
 ignores @kbd{C-c}.
 
+The @code{info threads} command displays whether a thread stopped due
+to an exception or whether it stopped while running a system call.
+For example:
+
+@smallexample
+(@value{GDBP}) info threads
+  Id  Target Id                        Frame
+  1   Thread 123.0x338                 main () at example.c:5
+  2   Thread 123.0xd58 (in syscall)    0x00007ffde37057b4 in
+                                         ntdll!ZwWaitForWorkViaWorkerFactory ()
+                                         from C:/WINDOWS/SYSTEM32/ntdll.dll
+* 3   Thread 123.0x2d4 (in exception)  0x00007ffde00aa464 in
+                                         KERNELBASE!CtrlRoutine ()
+                                         from C:/WINDOWS/System32/KERNELBASE.dll
+@end smallexample
+
+Above we see that thread 2 is blocked inside a system call, thread 3
+stopped for an exception, and thread 1 simply stopped while running
+user space code.  Debug events such as breakpoint traps, single-steps,
+and @samp{Ctrl-C} interruptions are considered exceptions.
+
 There are various additional Windows-specific commands, described in
 this section.  Working with DLLs that have no debugging symbols is
 described in @ref{Non-debug DLL Symbols}.

base-commit: 8c0ac471835ec86a67c5b42713d9f138f31e4014
prerequisite-patch-id: 9cbfcc1f25d6c22749699faeb50c2f3ca4632c07
prerequisite-patch-id: 248f41871a76de97d95de3538d27298cdc9b68ce
  
Eli Zaretskii May 8, 2026, 1:12 p.m. UTC | #3
> Date: Thu, 7 May 2026 18:59:36 +0100
> Cc: gdb-patches@sourceware.org
> From: Pedro Alves <pedro@palves.net>
> 
> On 2026-05-04 20:14, Eli Zaretskii wrote:
> >> From: Pedro Alves <pedro@palves.net>
> >> +@smallexample
> >> +(@value{GDBP}) info threads
> >> +  Id   Target Id                            Frame
> >> +  1    Thread 15648.0x4338                  main () at example.c:5
> >> +  2    Thread 15648.0x3d58 (in syscall)     0x00007ffde37057b4 in ntdll!ZwWaitForWorkViaWorkerFactory () from C:/WINDOWS/SYSTEM32/ntdll.dll
> >> +* 3    Thread 15648.0x12d4 (in exception)   0x00007ffde00aa464 in KERNELBASE!CtrlRoutine () from C:/WINDOWS/System32/KERNELBASE.dll
> >> +@end smallexample
> > 
> > Aren't these lines too long even for @smallexample?  Did you try
> > generating PDF, and if so, did you get "overlong" warnings from TeX?
> 
> Indeed, I hadn't looked at the PDF.  I don't get "overlong" warnings, but the
> example does not fit on a PDF page, and is cut on the right hand side.
> 
> I'd now trimmed as much as I could and wrapped the text in the "Frame" column.
> 
> Let me know if this looks OK to you this way.

This looks OK, thanks.
  

Patch

diff --git a/gdb/doc/gdb.texinfo b/gdb/doc/gdb.texinfo
index 29d959e68f7..318299fdd3d 100644
--- a/gdb/doc/gdb.texinfo
+++ b/gdb/doc/gdb.texinfo
@@ -25905,6 +25905,23 @@  supports @kbd{C-@key{BREAK}} as an alternative interrupt key
 sequence, which can be used to interrupt the debuggee even if it
 ignores @kbd{C-c}.
 
+The @code{info threads} command displays whether a thread stopped due
+to an exception or whether it stopped while running a system call.
+For example:
+
+@smallexample
+(@value{GDBP}) info threads
+  Id   Target Id                            Frame
+  1    Thread 15648.0x4338                  main () at example.c:5
+  2    Thread 15648.0x3d58 (in syscall)     0x00007ffde37057b4 in ntdll!ZwWaitForWorkViaWorkerFactory () from C:/WINDOWS/SYSTEM32/ntdll.dll
+* 3    Thread 15648.0x12d4 (in exception)   0x00007ffde00aa464 in KERNELBASE!CtrlRoutine () from C:/WINDOWS/System32/KERNELBASE.dll
+@end smallexample
+
+Above we see that thread 2 is blocked inside a system call, thread 3
+stopped for an exception, and thread 1 simply stopped while running
+user space code.  Debug events such as breakpoint traps, single-steps,
+and @samp{Ctrl-C} interruptions are considered exceptions.
+
 There are various additional Windows-specific commands, described in
 this section.  Working with DLLs that have no debugging symbols is
 described in @ref{Non-debug DLL Symbols}.