This is the mail archive of the
gdb@sources.redhat.com
mailing list for the GDB project.
Multiple locations vs. watchpoints.
- From: Daniel Jacobowitz <drow at mvista dot com>
- To: gdb at sources dot redhat dot com
- Date: Thu, 30 Oct 2003 00:53:45 -0500
- Subject: Multiple locations vs. watchpoints.
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