[RFA] Try 2: Use multiple locations for hardware watchpoints.

Vladimir Prus vladimir@codesourcery.com
Thu Nov 29 10:44:00 GMT 2007


On Wednesday 28 November 2007 20:14:28 you wrote:
> 
> This is a revised patch to make watchpoint use regular locations
> mechanism for storing locations to be watched. Compared to the
> previous patch:
> 
> - The 'update_watchpoint' function now updates the value stored
> inside breakpoint, removing the need for a special code for that
> purpose inside 'insert_breakpoints', which code had a FIXME saying
> it should be moved elsewhere. Since we call evaluate_expression
> anyway, update_watchpoint only needs a little care with memory management
> to do that -- there's no extra overhead.
> 
> - The 'update_watchpoint' function also has 'reparse' parameter, which
> causes it to reparse the watched expression. The breakpoint_re_set_one,
> for the case of watchpoints, now merely calls update_watchpoint.
> 
> - Presently, if I set a watchpoint on a global variable in an
> explicitly loaded shared library, and re-run the program, gdb promptly
> segfaults. This patch fixes that, and adds a testcase for that behaviour.
> 
> This patch should be applied on top of my previous breakpoint_re_set_on 
> watchpoint cleanup patch.

I've noticed that update_watchpoint fail to exit early in case the
breakpoint's disposition is disp_del_at_next_stop. That disposition is
used for breakpoints that we need to delete when they are out of scope --
that's kind of hack, as trying to call delete_breakpoint directly will
lead to crashes as later code touches this breakpoint. 

Without this check, nothing breaks, but we sometimes get a message about
a deleted watchpoint twice. To fix it, the below one-liner should
be applied on top of this patch.

- Volodya
-------------- next part --------------
A non-text attachment was scrubbed...
Name: delta.diff
Type: text/x-diff
Size: 435 bytes
Desc: not available
URL: <http://sourceware.org/pipermail/gdb-patches/attachments/20071129/4ea7759b/attachment.bin>


More information about the Gdb-patches mailing list