This is the mail archive of the gdb@sources.redhat.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]