From mboxrd@z Thu Jan 1 00:00:00 1970 From: Eli Zaretskii To: Andrew Cagney Cc: John Hughes , gdb-patches@sourceware.cygnus.com Subject: Re: minor fix for i386v-nat.c Date: Thu, 28 Jun 2001 03:41:00 -0000 Message-id: References: <3B3AB452.9000304@cygnus.com> X-SW-Source: 2001-06/msg00458.html 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.