This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
Re: proposed PATCH: make watchpoints work correctly
- From: "Eli Zaretskii" <eliz at elta dot co dot il>
- To: pkoning at equallogic dot com
- Cc: gdb-patches at sources dot redhat dot com
- Date: Wed, 28 May 2003 22:55:25 +0300
- Subject: Re: proposed PATCH: make watchpoints work correctly
- References: <16084.56661.295275.544414@pkoning.dev.equallogic.com>
- Reply-to: Eli Zaretskii <eliz at elta dot co dot il>
> Date: Wed, 28 May 2003 12:01:25 -0400
> From: Paul Koning <pkoning@equallogic.com>
>
> If HAVE_NONSTEPPABLE_WATCHPOINT is defined, watchpoints would not stop
> for several reasons. First of all, remote.c would return 0 rather
> than the watch address after the single step past the instruction
> where the watch trap occurred. (Changes to infrun.c, remote.c)
> Second, even after that is fixed, bpstat_stop_status wouldn't match
> the watchpoint because removing the watchpoint (to single step)
> deleted the valchain which is used to do the matching (Change to
> breakpoint.c)
>
> If a watchpoint is defined, but the program stops for some other
> reason -- either a breakpoint, or a break instruction hardcoded in the
> target code -- bpstat_stop_status would encounter the watchpoint in
> its scan for possible reasons. It would take no action on it but
> leave its "stop" and "print" bits set so you would see the stop
> reported as if it were a watchpoint hit. Also, a "next" or "step"
> command would act as "stepi", i.e., stop after every instruction.
> (Changes to breakpoint.c).
(It's been a while since I hacked on watchpoint-related code, so I
apologize in advance for asking possibly dumb questions.)
The above description made me nervous: it almost sounds like the
current watchpoint support is pretty much dysfunctional, as most of
the changes you suggest are not specific neither to remote.c nor to
HAVE_NONSTEPPABLE_WATCHPOINT. So could you please explain how, given
those deficiencies, watchpoints do work for native targets such as
x86, but did not work for your target?