From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 13532 invoked by alias); 1 Aug 2007 15:23:02 -0000 Received: (qmail 13522 invoked by uid 22791); 1 Aug 2007 15:23:02 -0000 X-Spam-Check-By: sourceware.org Received: from igw2.br.ibm.com (HELO igw2.br.ibm.com) (32.104.18.25) by sourceware.org (qpsmtpd/0.31) with ESMTP; Wed, 01 Aug 2007 15:22:51 +0000 Received: from mailhub1.br.ibm.com (mailhub1 [9.18.232.109]) by igw2.br.ibm.com (Postfix) with ESMTP id DA2A53CE4D7 for ; Wed, 1 Aug 2007 12:07:22 -0300 (BRT) Received: from d24av02.br.ibm.com (d24av02.br.ibm.com [9.18.232.47]) by mailhub1.br.ibm.com (8.13.8/8.13.8/NCO v8.4) with ESMTP id l71FI9aH1663126 for ; Wed, 1 Aug 2007 12:18:10 -0300 Received: from d24av02.br.ibm.com (loopback [127.0.0.1]) by d24av02.br.ibm.com (8.12.11.20060308/8.13.3) with ESMTP id l71FI8Nc010518 for ; Wed, 1 Aug 2007 12:18:09 -0300 Received: from [9.18.200.83] ([9.18.200.83]) by d24av02.br.ibm.com (8.12.11.20060308/8.12.11) with ESMTP id l71FI7WM010385 for ; Wed, 1 Aug 2007 12:18:08 -0300 Subject: HW Watchpoint events and the inferior From: Luis Machado Reply-To: luisgpm@linux.vnet.ibm.com To: gdb@sourceware.org Content-Type: text/plain Date: Wed, 01 Aug 2007 15:23:00 -0000 Message-Id: <1185981481.5248.11.camel@localhost> Mime-Version: 1.0 X-Mailer: Evolution 2.6.1 Content-Transfer-Encoding: 7bit X-IsSubscribed: yes Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org X-SW-Source: 2007-08/txt/msg00008.txt.bz2 Folks, I've been investigating watchpoints on GDB and i have a question on how GDB handles Hardware Watchpoint events and which TID it uses to grab information about the stopped_data_address, considering a multithreaded application. The stopped_data_address functions seem to use the current "inferior_ptid" variable to do a PTRACE request in order to get information from the debug registers. The "inferior_ptid" holds ID's for the task that was currently running when GDB stopped. Is it always true that, if we have a triggered hw watchpoint event, the inferior_ptid represents the task that actually triggered it? What if we did trigger a watchpoint but it was a different task (other than the current inferior_ptid) that triggered it? Will GDB eventually switch to the other task and confirm that we had a hw watchpoint trigger? It could also happen that two or more threads triggered a watchpoint. Does GDB handle those events sequentially? Just to make the scope clear, i'm trying to associate a specific hw watchpoint event with the thread that actually triggered it. It believe that would be useful information. Regards, -- Luis Machado Software Engineer IBM Linux Technology Center LoP Toolchain/Debuggers' team Phone: +55 19-2132-2218 T/L: 839-2218 e-mail: luisgpm@vnet.linux.ibm.com