This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
Re: [RFC]: x86 threaded watchpoint support [2/3]
- From: "Eli Zaretskii" <eliz at gnu dot org>
- To: jjohnstn <jjohnstn at redhat dot com>
- Cc: Ulrich dot Weigand at de dot ibm dot com, gdb-patches at sources dot redhat dot com
- Date: Thu, 17 Jun 2004 07:20:27 +0200
- Subject: Re: [RFC]: x86 threaded watchpoint support [2/3]
- References: <Pine.LNX.4.44.0406161722440.7927-100000@tooth.toronto.redhat.com>
- Reply-to: Eli Zaretskii <eliz at gnu dot org>
> Date: Wed, 16 Jun 2004 17:39:28 -0400 (EDT)
> From: jjohnstn <jjohnstn@redhat.com>
>
> Actually, I believe this patch needs to be reworked. It is causing a
> failure for ia64 watchpoints. There are a number of problems to be looked
> at. First of all, the stopped_by_watchpoint flag only gets set if
> HAVE_CONTINUABLE_WATCHPOINT is true. Thus, any platform that doesn't
> define this macro or have the low level target
> to_have_continuable_watchpoint value set, will never set the
> stopped_by_watchpoint flag. The logic in
> bpstat_stop_status ignores all hardware watchpoints if the flag is not set
> so we never do the value comparison.
>
> Another problem is that some watchpoints are stepped (i.e. the signal
> occurs before the value is actually changed). When we step over the
> watchpoint, again the flag won't get set because we have actually trapped
> due to a step operation, not a watchpoint.
Can you suggest a patch to take care of these problems?
> Knowing at least one watchpoint triggered is not enough detail. Gdb then
> has to check all values for change.
If all the platform does is tell us that _some_ watchpoint breaks,
what else can we do?
> We may not stop all threads until multiple watchpoints change.
This should produce several more SIGTRAPs, one each for every
watchpoint that triggers in between. Can we somehow find out there
are several more SIGTRAPs pending, and what threads have them pending?
If not, I again don't see how can GDB do better in this situation.
Sounds like some help from the kernel is in order.