This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
Re: RFA: Breakpoint infrastructure cleanups [1/8] - define impl_breakpoint
> Date: Wed, 8 Oct 2003 15:11:56 -0400
> From: Daniel Jacobowitz <drow@mvista.com>
> >
> > Why did you decide to leave the subclasses of hardware watchpoints
> > (read, access, and write) in the parent structure, instead of moving
> > that distinction here? That seems like you are spreading related
> > information between several places instead of having it in a single
> > place.
>
> I'm actually planning to move it to the impl_breakpoint.
Ah, okay then.
> For instance, according to my interpretation, rwatch **foo should be:
> a read watchpoint on the address *foo
> a write watchpoint on the address foo, in case it is moved.
> I don't know if that matches GDB's current interpreation of such
> expressions, though - I haven't looked yet.
GDB already does something similar, of course: that's why you see the
value chain being chased each time GDB inserts or removes watchpoints.
In this case, the value chain of **foo will include &foo as well.
Similar things happen with watching arrays and structs; the comments
in breakpoint.c should shed more light on this.
One other thing to keep in mind wrt watchpoints is that the
bp_hardware_watchpoint kind is handled differently from
bp_read_watchpoint and bp_access_watchpoint. I believe the reasons
are histerical, but I think you will need to know this while hacking
that part of the code, especially if you decide to change it so that
all 3 kinds are handled the same way, as I think they should.