From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 8777 invoked by alias); 26 Apr 2006 18:02:26 -0000 Received: (qmail 8769 invoked by uid 22791); 26 Apr 2006 18:02:25 -0000 X-Spam-Check-By: sourceware.org Received: from e33.co.us.ibm.com (HELO e33.co.us.ibm.com) (32.97.110.151) by sourceware.org (qpsmtpd/0.31) with ESMTP; Wed, 26 Apr 2006 18:02:18 +0000 Received: from westrelay02.boulder.ibm.com (westrelay02.boulder.ibm.com [9.17.195.11]) by e33.co.us.ibm.com (8.12.11.20060308/8.12.11) with ESMTP id k3QI2Ggs009265 for ; Wed, 26 Apr 2006 14:02:16 -0400 Received: from d03av02.boulder.ibm.com (d03av02.boulder.ibm.com [9.17.195.168]) by westrelay02.boulder.ibm.com (8.12.10/NCO/VER6.8) with ESMTP id k3QHwRUh260952 for ; Wed, 26 Apr 2006 11:58:27 -0600 Received: from d03av02.boulder.ibm.com (loopback [127.0.0.1]) by d03av02.boulder.ibm.com (8.12.11/8.13.3) with ESMTP id k3QI2GE2021659 for ; Wed, 26 Apr 2006 12:02:16 -0600 Received: from dufur.beaverton.ibm.com (dufur.beaverton.ibm.com [9.47.22.20]) by d03av02.boulder.ibm.com (8.12.11/8.12.11) with ESMTP id k3QI2Fm2021377 for ; Wed, 26 Apr 2006 12:02:16 -0600 Subject: watchpoints and threads From: PAUL GILLIAM Reply-To: pgilliam@us.ibm.com To: gdb@sources.redhat.com Content-Type: text/plain Date: Thu, 27 Apr 2006 12:04:00 -0000 Message-Id: <1146074582.18934.79.camel@dufur.beaverton.ibm.com> Mime-Version: 1.0 X-Mailer: Evolution 2.2.2 (2.2.2-5) Content-Transfer-Encoding: 7bit X-IsSubscribed: yes Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org X-SW-Source: 2006-04/txt/msg00322.txt.bz2 The manual states: _Warning:_ In multi-thread programs, watchpoints have only limited usefulness. With the current watchpoint implementation, GDB can only watch the value of an expression _in a single thread_. If you are confident that the expression can only change due to the current thread's activity (and if you are also confident that no other thread can become current), then you can use watchpoints as usual. However, GDB may not notice when a non-current thread's activity changes the expression. Yet the test testsuite/gdb.threads/watchthreads.exp contains the following: # Verify that we hit first watchpoint in child thread. set message "watchpoint on args\[0\] hit in thread" if { $args_1 > 1 } { pass $message } else { fail $message } This seems like a conflict. What brought this up is a user who wants this scenario to work: * The target program has a global variable. * GDB is started and a 'watch' command is give for that variable. * Some number of threads are started. * If _any_ thread changes the value of the global variable, _all_ threads stop. The manual seems to say that this scenario will not work, but the testcase seems to say that it will. What's the story? -=# Paul #=-