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