Re: [RFC] Interaction between HW watchpoints and 'set var'.

Joel Brobecker
2009-11-25T18:06:39Z

Interesting. One thing that you don't see is the behavior when using
software watchpoints. My guess is that you'd see the debugger stop
immediately at the first resume because the value looks new to GDB
as well.

> Now, I can fix that by installing deprecated_memory_changed_hook,
> but the deprecated part gives me pause.
>
> Should I create a new memory_changed observer and remove
> deprecated_memory_changed_hook instead?

After reviewing the history of that hook, I think it would be a desired
cleanup to have a memory_changed observer. Once you have the observer,
you'll want to (possibly) re-evaluate the watchpoint value every time
the memory changes. Not sure how to best implement that, but one issue
you might face is when the user is updating the variable value while
it being out of scope... If you manipulate memory blocks exclusively,
then it shouldn't be a problem, but if you re-evaluate using the
watchpoint expression, it might be.

--
Joel