Re: Multiple locations vs. watchpoints.

Peter Barada
2003-10-30T06:25:39Z

>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