This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
Re: Display of read/access watchpoints when HAVE_NONSTEPPABLE_WATCHPOINT
>>>>> "Ulrich" == Ulrich Weigand <weigand@i1.informatik.uni-erlangen.de> writes:
>> My experience was that the old code worked if you had only a
>> watchpoint active, but it would produce the wrong results if you
>> had both watchpoints and breakpoints active. The reason was that
>> the scan for matching break/watch points would conclude that the
>> target break had happened due to a non-matching watchpoint and
>> would proceed, rather than break.
Ulrich> But this error scenario should only apply to read/access
Ulrich> watchpoints, never write watchpoints. A write watchpoint
Ulrich> should never be misdetected ...
Sorry, I wasn't clear in the explanation, faulty memory.
The actual explanation: a "hard breakpoint" ("break" instruction
assembled-in, rather than inserted by gdb) is detected by the fact
that nothing matches in the scan of the break/watch point list.
The original code would work correctly if only breakpoints were set.
If watchpoints were also set, a hard breakpoint would be treated as a
mismatched watchpoint, and gdb would just continue rather than
stopping.
>> That doesn't seem like a good idea. Why would it be reasonable to
>> treat the two differently?
Ulrich> Because a write watchpoints can be handled without hardware
Ulrich> support to provide the address, while read/access watchpoints
Ulrich> fundamentally cannot be.
Except for the issue that Daniel just mentioned (foo = 1; foo = 1;)
paul