Multiple locations vs. watchpoints.

Daniel Jacobowitz
2003-10-30T05:53:48Z

Just something I was thinking about while writing my last message...

Suppose we have this:
foo.c:static int *bar;

(gdb) watch *bar

My idea has sort of been to create a watchpoint with multiple locations, one
for bar and one for *bar, each representing a conceptual hardware watchpoint
(though not necessarily one hardware watchpoint resource).

And for this:
foo.c:static int foo()
bar.c:static int foo()

(gdb) break foo

My idea has sort of been that we should have a breakpoint with two
bp_locations, one for foo.c:foo and one for bar.c:foo.

But suppose we have this:
foo.c:static int *bar;
bar.c:static int *bar;

(gdb) watch *bar

It watches whatever *bar would print, which is one of them. No easy way to
get at the other or describe the ambiguity. I wonder once again whether the
two-level scheme is really correctly designed; but I have no better ideas.

--
Daniel Jacobowitz
MontaVista Software Debian GNU/Linux Developer