This is the mail archive of the
gdb@sourceware.org
mailing list for the GDB project.
HW Watchpoint events and the inferior
- From: Luis Machado <luisgpm at linux dot vnet dot ibm dot com>
- To: gdb at sourceware dot org
- Date: Wed, 01 Aug 2007 12:18:01 -0300
- Subject: HW Watchpoint events and the inferior
- Reply-to: luisgpm at linux dot vnet dot ibm dot com
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