From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 26387 invoked by alias); 11 Jan 2011 21:09:12 -0000 Received: (qmail 26376 invoked by uid 22791); 11 Jan 2011 21:09:11 -0000 X-SWARE-Spam-Status: No, hits=-6.9 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_HI,SPF_HELO_PASS,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 11 Jan 2011 21:09:06 +0000 Received: from int-mx02.intmail.prod.int.phx2.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id p0BL94QW026987 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Tue, 11 Jan 2011 16:09:04 -0500 Received: from ns3.rdu.redhat.com (ns3.rdu.redhat.com [10.11.255.199]) by int-mx02.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id p0BL94gi030712; Tue, 11 Jan 2011 16:09:04 -0500 Received: from opsy.redhat.com (ovpn01.gateway.prod.ext.phx2.redhat.com [10.5.9.1]) by ns3.rdu.redhat.com (8.13.8/8.13.8) with ESMTP id p0BL93HV007614; Tue, 11 Jan 2011 16:09:03 -0500 Received: by opsy.redhat.com (Postfix, from userid 500) id 390B637848D; Tue, 11 Jan 2011 14:09:02 -0700 (MST) From: Tom Tromey To: gdb-patches@sourceware.org Subject: RFA: update Threads section of manual Date: Tue, 11 Jan 2011 21:22:00 -0000 Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2011-01/txt/msg00233.txt.bz2 This needs a doc review. The `Threads' node in the manual has a lot of duplicate text and some out-of-date examples. Also the `all' argument to `thread apply' is erroneously put into @var{}. This patch fixes the problems. Ok? Tom 2011-01-11 Tom Tromey * gdb.texinfo (Threads): Remove duplicate text. Update examples. Fix "thread apply" text. Index: gdb.texinfo =================================================================== RCS file: /cvs/src/src/gdb/doc/gdb.texinfo,v retrieving revision 1.788 diff -u -r1.788 gdb.texinfo --- gdb.texinfo 11 Jan 2011 19:23:03 -0000 1.788 +++ gdb.texinfo 11 Jan 2011 21:07:47 -0000 @@ -2731,70 +2731,13 @@ @smallexample (@value{GDBP}) info threads - 3 process 35 thread 27 0x34e5 in sigpause () - 2 process 35 thread 23 0x34e5 in sigpause () -* 1 process 35 thread 13 main (argc=1, argv=0x7ffffff8) + Id Target Id Frame + 3 process 35 thread 27 0x34e5 in sigpause () + 2 process 35 thread 23 0x34e5 in sigpause () +* 1 process 35 thread 13 main (argc=1, argv=0x7ffffff8) at threadtest.c:68 @end smallexample -On HP-UX systems: - -@cindex debugging multithreaded programs (on HP-UX) -@cindex thread identifier (GDB), on HP-UX -For debugging purposes, @value{GDBN} associates its own thread -number---a small integer assigned in thread-creation order---with each -thread in your program. - -@cindex @code{New} @var{systag} message, on HP-UX -@cindex thread identifier (system), on HP-UX -@c FIXME-implementors!! It would be more helpful if the [New...] message -@c included GDB's numeric thread handle, so you could just go to that -@c thread without first checking `info threads'. -Whenever @value{GDBN} detects a new thread in your program, it displays -both @value{GDBN}'s thread number and the target system's identification for the thread with a message in the -form @samp{[New @var{systag}]}. @var{systag} is a thread identifier -whose form varies depending on the particular system. For example, on -HP-UX, you see - -@smallexample -[New thread 2 (system thread 26594)] -@end smallexample - -@noindent -when @value{GDBN} notices a new thread. - -@table @code -@kindex info threads (HP-UX) -@item info threads -Display a summary of all threads currently in your -program. @value{GDBN} displays for each thread (in this order): - -@enumerate -@item the thread number assigned by @value{GDBN} - -@item the target system's thread identifier (@var{systag}) - -@item the current stack frame summary for that thread -@end enumerate - -@noindent -An asterisk @samp{*} to the left of the @value{GDBN} thread number -indicates the current thread. - -For example, -@end table -@c end table here to get a little more width for example - -@smallexample -(@value{GDBP}) info threads - * 3 system thread 26607 worker (wptr=0x7b09c318 "@@") \@* - at quicksort.c:137 - 2 system thread 26606 0x7b0030d8 in __ksleep () \@* - from /usr/lib/libc.2 - 1 system thread 27905 0x7b003498 in _brk () \@* - from /usr/lib/libc.2 -@end smallexample - On Solaris, you can display more information about user threads with a Solaris-specific command: @@ -2815,10 +2758,10 @@ you selected, and its current stack frame summary: @smallexample -@c FIXME!! This example made up; find a @value{GDBN} w/threads and get real one (@value{GDBP}) thread 2 -[Switching to process 35 thread 23] -0x34e5 in sigpause () +[Switching to thread 2 (Thread 0xb7fdab70 (LWP 12747))] +#0 some_function (ignore=0x0) at example.c:8 +8 printf ("hello\n"); @end smallexample @noindent @@ -2835,7 +2778,7 @@ @kindex thread apply @cindex apply command to several threads -@item thread apply [@var{threadno}] [@var{all}] @var{command} +@item thread apply [@var{threadno} | 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