Re: minor fix for i386v-nat.c

Eli Zaretskii
2001-06-28T03:41:00Z

On Thu, 28 Jun 2001, Andrew Cagney wrote:

> Did anyone ever look at this?

Is any x86 port still using this code? I'd expect them all to switch
to the new watchpoint support in i386-nat.c, by now.

> > In i386_insert_aligned_watchpoint the actual address being watched
> > was saved in address_loookup. This is fine for aligned
> > watchpoints, the address gdb wants to watch is the same as the
> > actual address. For non-aligned watchpoints we have to ask the
> > hadware to watch up to 3 different addresses. We need to remember
> > the address gdb wants to watch so i386_remove_watchpoint knows
> > which registers to clean up.

Won't this do the wrong thing in i386_stopped_by_watchpoint? You'll
report the wrong address there (not the one the debug register
actually watched).

I think a cleaner way to do this is to store the actual address being
watched by the DRi, but to modify i386_remove_watchpoint to break up
its act into several individual removals like
i386_insert_aligned_watchpoint does. This is what the code in
i386-nat.c does.