(Backtrace): Describe how to get backtrace of all the threads in a
authorEli Zaretskii <eliz@gnu.org>
Sat, 21 Jan 2006 21:14:10 +0000 (21:14 +0000)
committerEli Zaretskii <eliz@gnu.org>
Sat, 21 Jan 2006 21:14:10 +0000 (21:14 +0000)
multi-threaded program.
(Threads): The threadno argument of "thread apply" can be a range of numbers.

gdb/doc/ChangeLog
gdb/doc/gdb.texinfo

index c48c8f0f3445eb4f220d6f67cdaf8fd5a8e74387..d9aac344d5b1692911d22602c10439bc4c9ab5ee 100644 (file)
@@ -1,3 +1,10 @@
+2006-01-21  Eli Zaretskii  <eliz@gnu.org>
+
+       * gdb.texinfo (Backtrace): Describe how to get backtrace of all
+       the threads in a multi-threaded program.
+       (Threads): The threadno argument of "thread apply" can be a range
+       of numbers.
+
 2006-01-18  Jim Blandy  <jimb@redhat.com>
 
        * gdbint.texinfo (Coding): Add entry for -Wno-pointer-sign to list
index 91600942d5f7ee75a7270b88c6990cd4e2a586fd..c17520a103f8fd0b7ea2af91e806eaa40bf27105 100644 (file)
@@ -2424,13 +2424,14 @@ threads.
 
 @kindex thread apply
 @cindex apply command to several threads
-@item thread apply [@var{threadno}] [@var{all}]  @var{args}
-The @code{thread apply} command allows you to apply a command to one or
-more threads.  Specify the numbers of the threads that you want affected
-with the command argument @var{threadno}.  @var{threadno} is the internal
-@value{GDBN} thread number, as shown in the first field of the @samp{info
-threads} display.  To apply a command to all threads, use
-@code{thread apply all} @var{args}.
+@item thread apply [@var{threadno}] [@var{all}] @var{command}
+The @code{thread apply} command allows you to apply the named
+@var{command} to one or more threads.  Specify the numbers of the
+threads that you want affected with the command argument
+@var{threadno}.  It can be a single thread number, one of the numbers
+shown in the first field of the @samp{info threads} display; or it
+could be a range of thread numbers, as in @code{2-4}.  To apply a
+command to all threads, type @kbd{thread apply all @var{command}}.
 @end table
 
 @cindex automatic thread selection
@@ -4461,6 +4462,15 @@ Print the values of the local variables also.
 The names @code{where} and @code{info stack} (abbreviated @code{info s})
 are additional aliases for @code{backtrace}.
 
+@cindex multiple threads, backtrace
+In a multi-threaded program, @value{GDBN} by default shows the
+backtrace only for the current thread.  To display the backtrace for
+several or all of the threads, use the command @code{thread apply}
+(@pxref{Threads, thread apply}).  For example, if you type @kbd{thread
+apply all backtrace}, @value{GDBN} will display the backtrace for all
+the threads; this is handy when you debug a core dump of a
+multi-threaded program.
+
 Each line in the backtrace shows the frame number and the function name.
 The program counter value is also shown---unless you use @code{set
 print address off}.  The backtrace also shows the source file name and
This page took 0.044136 seconds and 4 git commands to generate.