A patch for ia32 hardware watchpoint.
Eli Zaretskii
eliz@delorie.com
Wed Mar 8 03:32:00 GMT 2000
> > @@ -5500,13 +5513,13 @@ watch_command_1 (arg, accessflag, from_t
> > in hardware return zero. */
> >
> > #if !defined(TARGET_REGION_SIZE_OK_FOR_HW_WATCHPOINT)
> > -#define TARGET_REGION_SIZE_OK_FOR_HW_WATCHPOINT(BYTE_SIZE) \
> > - ((BYTE_SIZE) <= (REGISTER_SIZE))
> > +#define TARGET_REGION_SIZE_OK_FOR_HW_WATCHPOINT(VAL) \
> > + (TYPE_LENGTH (VALUE_TYPE (VAL)) <= (REGISTER_SIZE))
> > #endif
> >
> > #if !defined(TARGET_REGION_OK_FOR_HW_WATCHPOINT)
> > -#define TARGET_REGION_OK_FOR_HW_WATCHPOINT(ADDR,LEN) \
> > - TARGET_REGION_SIZE_OK_FOR_HW_WATCHPOINT(LEN)
> > +#define TARGET_REGION_OK_FOR_HW_WATCHPOINT(VAL) \
> > + TARGET_REGION_SIZE_OK_FOR_HW_WATCHPOINT(VAL)
> > #endif
>
> These are IMHO wrong: the number of debug registers required for a
> particular region is a function of the address, not only size (e.g., a
> single x86 debug register cannot watch a 32-bit region that isn't
> aligned on 4-byte boundary). If Linux, for some reason, doesn't need
> the address (although I cannot see how could this be right, at least
> for native debugging), please define a platform-specific macro instead
> of overwriting system-wide defaults.
Sorry, I talked too soon. These changes supply all the required info,
since they pass the entire struct value to the macro. So they are
okay with me.
I'm terribly sorry for jumping the gun for no reason.
The rest of my comments about these patches are still valid, though.
More information about the Gdb
mailing list