Mirror of the gdb mailing list
 help / color / mirror / Atom feed
* HW Watchpoint events and the inferior
@ 2007-08-01 15:23 Luis Machado
  2007-08-01 16:00 ` Daniel Jacobowitz
  0 siblings, 1 reply; 4+ messages in thread
From: Luis Machado @ 2007-08-01 15:23 UTC (permalink / raw)
  To: gdb

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


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: HW Watchpoint events and the inferior
  2007-08-01 15:23 HW Watchpoint events and the inferior Luis Machado
@ 2007-08-01 16:00 ` Daniel Jacobowitz
  2007-08-01 17:13   ` Luis Machado
  0 siblings, 1 reply; 4+ messages in thread
From: Daniel Jacobowitz @ 2007-08-01 16:00 UTC (permalink / raw)
  To: Luis Machado; +Cc: gdb

On Wed, Aug 01, 2007 at 12:18:01PM -0300, Luis Machado wrote:
> 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.

GDB does not contain support for watchpoints in multi-threaded
programs.  You can find several patches and discussions of this issue
in the list archives as recently as the end of June.

In reply to a message from you, in fact!

-- 
Daniel Jacobowitz
CodeSourcery


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: HW Watchpoint events and the inferior
  2007-08-01 16:00 ` Daniel Jacobowitz
@ 2007-08-01 17:13   ` Luis Machado
  2007-08-02 17:16     ` Daniel Jacobowitz
  0 siblings, 1 reply; 4+ messages in thread
From: Luis Machado @ 2007-08-01 17:13 UTC (permalink / raw)
  To: Daniel Jacobowitz; +Cc: gdb

Hi,

On Wed, 2007-08-01 at 12:00 -0400, Daniel Jacobowitz wrote:
> On Wed, Aug 01, 2007 at 12:18:01PM -0300, Luis Machado wrote:
> > 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.
> 
> GDB does not contain support for watchpoints in multi-threaded
> programs.  You can find several patches and discussions of this issue
> in the list archives as recently as the end of June.

Yes, in fact i'm looking forward to improve that situation. That's why i'm going through some of the inferior handling code. Unfortunatelly there isn't much documentation there, and sometimes it gets rather bleak as to what GDB is really trying to do, and how it would handle multiple traps.


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


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: HW Watchpoint events and the inferior
  2007-08-01 17:13   ` Luis Machado
@ 2007-08-02 17:16     ` Daniel Jacobowitz
  0 siblings, 0 replies; 4+ messages in thread
From: Daniel Jacobowitz @ 2007-08-02 17:16 UTC (permalink / raw)
  To: Luis Machado; +Cc: gdb

On Wed, Aug 01, 2007 at 02:13:27PM -0300, Luis Machado wrote:
> Yes, in fact i'm looking forward to improve that situation. That's
> why i'm going through some of the inferior handling
> code. Unfortunatelly there isn't much documentation there, and
> sometimes it gets rather bleak as to what GDB is really trying to
> do, and how it would handle multiple traps.

It's not sensible to ask how GDB handles this sort of thing, until it
actually does.  Did you mean how it _should_ handle it?

Are you starting from Jan's patches?  If not, why did you decide not
to?  I have been assuming that it would be a simple matter of merging
them.

-- 
Daniel Jacobowitz
CodeSourcery


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2007-08-02 17:16 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-08-01 15:23 HW Watchpoint events and the inferior Luis Machado
2007-08-01 16:00 ` Daniel Jacobowitz
2007-08-01 17:13   ` Luis Machado
2007-08-02 17:16     ` Daniel Jacobowitz

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox