From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 1042 invoked by alias); 25 Mar 2009 22:02:51 -0000 Received: (qmail 1005 invoked by uid 22791); 25 Mar 2009 22:02:50 -0000 X-SWARE-Spam-Status: No, hits=-2.1 required=5.0 tests=AWL,BAYES_00,J_CHICKENPOX_37 X-Spam-Check-By: sourceware.org Received: from rock.gnat.com (HELO rock.gnat.com) (205.232.38.15) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 25 Mar 2009 22:02:44 +0000 Received: from localhost (localhost.localdomain [127.0.0.1]) by filtered-rock.gnat.com (Postfix) with ESMTP id 1E98F2BAB07 for ; Wed, 25 Mar 2009 18:02:43 -0400 (EDT) Received: from rock.gnat.com ([127.0.0.1]) by localhost (rock.gnat.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id dy+HqFHbj-Qj for ; Wed, 25 Mar 2009 18:02:43 -0400 (EDT) Received: from joel.gnat.com (localhost.localdomain [127.0.0.1]) by rock.gnat.com (Postfix) with ESMTP id D658E2BABAA for ; Wed, 25 Mar 2009 18:02:42 -0400 (EDT) Received: by joel.gnat.com (Postfix, from userid 1000) id 29EE75BD21; Wed, 25 Mar 2009 15:02:36 -0700 (PDT) Date: Wed, 25 Mar 2009 22:11:00 -0000 From: Joel Brobecker To: gdb-patches@sourceware.org Subject: Re: [RFA/doco] Document task-specific breakpoints Message-ID: <20090325220236.GF9472@adacore.com> References: <20090325214556.GD9472@adacore.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="G44BJl3Aq1QbV/QL" Content-Disposition: inline In-Reply-To: <20090325214556.GD9472@adacore.com> User-Agent: Mutt/1.5.18 (2008-05-17) 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: 2009-03/txt/msg00568.txt.bz2 --G44BJl3Aq1QbV/QL Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-length: 322 [with the right patch, sorry] Hello, As promised when I sent the code patches for task-specific breakpoints, here is the associated documentation. 2009-03-25 Joel Brobecker * gdb.texinfo (Ada Tasks): Add documentation about task-specific breakpoints. OK to commit? -- Joel --G44BJl3Aq1QbV/QL Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="task-doc.diff" Content-length: 2519 commit a786896e6559c568c3afea276bdc240ca8814dae Author: Joel Brobecker Date: Wed Mar 25 14:42:30 2009 -0700 * gdb.texinfo (Ada Tasks): Add documentation about task-specific breakpoints. diff --git a/gdb/doc/gdb.texinfo b/gdb/doc/gdb.texinfo index 134919d..92b4609 100644 --- a/gdb/doc/gdb.texinfo +++ b/gdb/doc/gdb.texinfo @@ -11743,6 +11743,59 @@ from the current task to the given task. #4 0x804aacc in un () at un.adb:5 @end smallexample +@item break @var{linespec} task @var{taskno} +@itemx break @var{linespec} task @var{taskno} if @dots{} +@cindex breakpoints and tasks +@cindex task breakpoints +@kindex break @dots{} task @var{taskno} +These commands are like the @code{break @dots{} thread @dots{}} +command (@pxref{Thread Stops}). +@var{linespec} specifies source lines, as described +in @ref{Set Breaks,,Setting breakpoints}. + +Use the qualifier @samp{task @var{taskno}} with a breakpoint command +to specify that you only want @value{GDBN} to stop the program when a +particular Ada task reaches this breakpoint. @var{taskno} is one of the +numeric task identifiers assigned by @value{GDBN}, shown in the first +column of the @samp{info tasks} display. + +If you do not specify @samp{task @var{taskno}} when you set a +breakpoint, the breakpoint applies to @emph{all} tasks of your +program. + +You can use the @code{task} qualifier on conditional breakpoints as +well; in this case, place @samp{task @var{taskno}} before the +breakpoint condition (before the @code{if}). + +For example, + +@smallexample +@iftex +@leftskip=0.5cm +@end iftex +(@value{GDBP}) info tasks + ID TID P-ID Pri State Name + 1 140022020 0 15 Child Activation Wait main_task + 2 140045060 1 15 Accept/Select Wait t2 + 3 140044840 1 15 Runnable t1 +* 4 140056040 1 15 Running t3 +(@value{GDBP}) b 15 task 2 +Breakpoint 5 at 0x120044cb0: file test_task_debug.adb, line 15. +(@value{GDBP}) cont +Continuing. +task # 1 running +task # 2 running + +Breakpoint 5, test_task_debug.tB.1 (_task=0x11ffffc60) + at test_task_debug.adb:15 +15 flush; +(@value{GDBP}) info tasks + ID TID P-ID Pri State Name + 1 140022020 0 15 Child Activation Wait main_task +* 2 140045060 1 15 Running t2 + 3 140044840 1 15 Runnable t1 + 4 140056040 1 15 Delay Sleep t3 +@end smallexample @end table @node Ada Tasks and Core Files --G44BJl3Aq1QbV/QL--