From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 31742 invoked by alias); 17 Dec 2007 16:46:23 -0000 Received: (qmail 31734 invoked by uid 22791); 17 Dec 2007 16:46:23 -0000 X-Spam-Check-By: sourceware.org Received: from mail.codesourcery.com (HELO mail.codesourcery.com) (65.74.133.4) by sourceware.org (qpsmtpd/0.31) with ESMTP; Mon, 17 Dec 2007 16:46:14 +0000 Received: (qmail 17055 invoked from network); 17 Dec 2007 16:46:11 -0000 Received: from unknown (HELO localhost) (jimb@127.0.0.2) by mail.codesourcery.com with ESMTPA; 17 Dec 2007 16:46:11 -0000 To: gdb-patches@sourceware.org Subject: RFA: Fix per-thread watchpoint documentation From: Jim Blandy Date: Mon, 17 Dec 2007 17:13:00 -0000 Message-ID: User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-IsSubscribed: yes 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: 2007-12/txt/msg00274.txt.bz2 The GDB documentation doesn't build at the moment, because the per-thread watchpoint documentation introduces an @item outside any @table. One could fix this by simply wrapping a @table around the new @item, but it doesn't seem to me that that description is in the right place within its node. So, does this look okay? gdb/doc/ChangeLog: 2007-12-17 Jim Blandy * doc/gdb.texinfo: Integrate per-thread watchpoint explanation into the main description of the watchpoint command. diff -r f76996bac30f gdb/doc/gdb.texinfo --- a/gdb/doc/gdb.texinfo Mon Dec 17 08:21:17 2007 -0800 +++ b/gdb/doc/gdb.texinfo Mon Dec 17 08:38:52 2007 -0800 @@ -3222,7 +3222,7 @@ watchpoints, which do not slow down the @table @code @kindex watch -@item watch @var{expr} +@item watch @var{expr} @r{[}thread @var{threadnum}@r{]} Set a watchpoint for an expression. @value{GDBN} will break when the expression @var{expr} is written into by the program and its value changes. The simplest (and the most popular) use of this command is @@ -3232,13 +3232,20 @@ to watch the value of a single variable: (@value{GDBP}) watch foo @end smallexample +If the command includes a @code{@r{[}thread @var{threadnum}@r{]}} +clause, @value{GDBN} breaks only when the thread identified by +@var{threadnum} changes the value of @var{expr}. If any other threads +change the value of @var{expr}, @value{GDBN} will not break. Note +that watchpoints restricted to a single thread in this way only work +with Hardware Watchpoints. + @kindex rwatch -@item rwatch @var{expr} +@item rwatch @var{expr} @r{[}thread @var{threadnum}@r{]} Set a watchpoint that will break when the value of @var{expr} is read by the program. @kindex awatch -@item awatch @var{expr} +@item awatch @var{expr} @r{[}thread @var{threadnum}@r{]} Set a watchpoint that will break when @var{expr} is either read from or written into by the program. @@ -3356,13 +3363,6 @@ way of doing that would be to set a code @cindex threads and watchpoints In multi-threaded programs, watchpoints will detect changes to the watched expression from every thread. - -@kindex watch thread thread_num -@item watch @var{expr} thread @var{threadnum} -Set a watchpoint that will break when @var{expr} is either read from -or written into by the thread identified by @var{threadnum}. If @var{expr} -is modified by any other threads not matching @var{threadnum}, @value{GDBN} -will not break. Note that this will only work with Hardware Watchpoints. @quotation @emph{Warning:} In multi-threaded programs, software watchpoints