This is the mail archive of the gdb@sourceware.cygnus.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Your change to can_use_hardware_watchpoint breaks hw wp


> 
> 
> > Could you please tell me what bug your patch tried to fix?
> 
> It fixes two problems:
> 
>  - the previous code used a macro that only looked at the watched
>    region's size, whereas some platforms, like x86, need to know the
>    address itself as well, because the alignment of the address is
>    important in order to compute how many debug registers are
>    required to watch the region.  Hence the new macro,
>    TARGET_REGION_OK_FOR_HW_WATCHPOINT.
> 
>  - the other problem, which I'm guessing is the one that caused you
>    grief, is that the old code would simply ignore values on the value
>    chain that were not in memory, when checking whether the expression
>    can be watched with hardware watchpoints.  By contrast, when the
>    time came to actually insert the watchpoints, any value that is not
>    in memory would cause GDB to fail to insert the watchpoint.  The
>    change made GDB's behavior consistent, in that it would not even
>    try hardware watchpoints if some value on the value chain is not in
>    memory.
> 
> The latter issue was discussed on this list under the subject "Code in
> can_use_hardware_watchpoint()" starting on 15 Aug.  The conclusion was
> that the change was a Good Thing.
> 

Do you have access to a Linux/x86 machine? Could you please try
gdb 4.17.0.13 to see if it has the problems you tried to fix?
I think my kludge works around them.

Thanks.


-- 
H.J. Lu (hjl@gnu.org)

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]