From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 11234 invoked by alias); 22 Sep 2007 15:46:37 -0000 Received: (qmail 11223 invoked by uid 22791); 22 Sep 2007 15:46:36 -0000 X-Spam-Check-By: sourceware.org Received: from romy.inter.net.il (HELO romy.inter.net.il) (213.8.233.24) by sourceware.org (qpsmtpd/0.31) with ESMTP; Sat, 22 Sep 2007 15:46:34 +0000 Received: from HOME-C4E4A596F7 (IGLD-84-229-122-46.inter.net.il [84.229.122.46]) by romy.inter.net.il (MOS 3.7.3-GA) with ESMTP id IYG03532 (AUTH halo1); Sat, 22 Sep 2007 17:46:21 +0200 (IST) Date: Sat, 22 Sep 2007 15:46:00 -0000 Message-Id: From: Eli Zaretskii To: Daniel Jacobowitz CC: gdb-patches@sourceware.org In-reply-to: <20070922153709.GA10743@caradoc.them.org> (message from Daniel Jacobowitz on Sat, 22 Sep 2007 11:37:09 -0400) Subject: Re: [rfc, rfa/doc] Multi-threaded watchpoint improvements Reply-to: Eli Zaretskii References: <20070916183949.GA23966@caradoc.them.org> <20070922140409.GB6285@caradoc.them.org> <20070922153709.GA10743@caradoc.them.org> 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-09/txt/msg00302.txt.bz2 > Date: Sat, 22 Sep 2007 11:37:09 -0400 > From: Daniel Jacobowitz > Cc: gdb-patches@sourceware.org > > On Sat, Sep 22, 2007 at 04:13:24PM +0200, Eli Zaretskii wrote: > > > > > +@value{GDBN} only supports process-wide watchpoints. > > > > > > > > "Process-wide watchpoints'' as opposed to what? > > > > > > As opposed to thread-specific watchpoints. We can make a watchpoint > > > act like it is thread-specific (or we will be able to once Luis's > > > patch is done), but we don't support setting hardware watchpoints that > > > only trigger in a specific thread. Yet, anyway. > > > > I think you should add something like this explanation, to make the > > intent clear. > > Is this clearer? > > @value{GDBN} only supports process-wide watchpoints, which trigger in > all threads. If the target supports threads, per-thread debug > registers, and watchpoints which only affect a single thread, it > should set the per-thread debug registers for all threads to the same > value. On @sc{gnu}/Linux native targets, this is accomplished by > using @code{ALL_LWPS} in @code{target_insert_watchpoint} and > @code{target_remove_watchpoint} and by using > @code{linux_set_new_thread} to register a handler for newly created > threads. A bit clearer, but not yet where I'd be happy. The following version expands the description a little, using your mail explanations almost intact: @value{GDBN} only supports process-wide watchpoints, which trigger in all threads. @value{GDBN} uses the thread ID to make watchpoints act as if they were thread-specific, but it cannot set hardware watchpoints that only trigger in a specific thread. Therefore, even if the target supports threads, per-thread debug registers, and watchpoints which only affect a single thread, it should set the per-thread debug registers for all threads to the same value. On @sc{gnu}/Linux native targets, this is accomplished by using @code{ALL_LWPS} in @code{target_insert_watchpoint} and @code{target_remove_watchpoint} and by using @code{linux_set_new_thread} to register a handler for newly created threads. WDYT?