[Converted from Gnats 1448] GDB doesn't know about the global scope operator, i.e. that, given, foo() { std::cout << "global foo\n"; } namespace N { foo() { std::cout << "N::foo\n"; ::foo(); } } then the expression '::foo()' within N::foo refers to the global foo() function. Release: unknown Environment: mainline GDB, 2003-11-11
I tried this with a recent (F11 system) gcc and CVS head gdb, and it worked fine. Complete test case: int func () { return 23; } namespace N { int func () { return 2 + ::func(); } }; int main () { return N::func(); } (gdb) start Temporary breakpoint 1 at 0x804845e: file pr.cc, line 14. Starting program: /home/tromey/gnu/PRS/gdb8553/pr Temporary breakpoint 1, main () at pr.cc:14 14 return N::func(); (gdb) s N::func () at pr.cc:8 8 return 2 + ::func(); (gdb) p ::func() $1 = 23 (gdb) p N::func() $2 = 25
There is some additional work being done at Bug 11703.
Related fix: http://sourceware.org/ml/gdb-cvs/2010-06/msg00197.html