On 8/30/19 3:21 AM, Richard Henderson wrote: > On 8/29/19 10:26 AM, Philippe Mathieu-Daudé wrote: >>> - wp->hitaddr = vaddr; >>> + wp->hitaddr = MAX(addr, wp->vaddr); >> >> When is addr > wp->vaddr? > > Both the watchpoint and the access are arbitrary ranges. > > wp: [ 1000 - 1008 ] > store: [ 1002 - 1004 ] > > wp: [ 1004 - 1008 ] > store: [ 1000 - 1008 ] > > The old code would, for the first case, return 1002 and not the 1000 of the > watch point, which seems reasonable. For the second case, we would set 1000, > an address outside of the watchpoint. > > David's change makes sure that the address signaled is inside the watchpoint. > I.e. leaving the first case unchanged and making the second set 1004. > > It seems very reasonable to me.
Thanks for the very clear explanation :) If you have time, few lines of comment around would be very appreciated... Now that it is clearer: Reviewed-by: Philippe Mathieu-Daudé <phi...@redhat.com> Regards, Phil.