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]

Re: Multiple locations vs. watchpoints.


>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.

You should be able to specify 'watch func::*bar' where func is the name of a
function that has scope on the *bar you are interested in.

I haven't tried this myself, but 'p/x func::foo' is something I've
done too many times to count so reason leads me to believe that the
watch command should use the same evaluator, right?

-- 
Peter Barada
peter@baradas.org


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