This is the mail archive of the gdb-prs@sourceware.org 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]

[Bug c++/16874] Setting a breakpoint on function in anonymous namespace is unnecessarily awkward


https://sourceware.org/bugzilla/show_bug.cgi?id=16874

--- Comment #8 from Richard Guenther <rguenth at gcc dot gnu.org> ---
The workaround works to some extent, but tab-completion is still broken
and for

t1.C
-----
namespace { int foo (void) { return 0; } }
int bar(void);
int main() { return foo () + bar (); }

t2.C
-----
namespace { int foo2 (void) { return 1; } }
int bar () { return foo2 (); }

it doesn't allow me to set a breakpoint on t2.C::foo2 until I enter bar().
That is, using 'b *<name>' seems to do symbol lookup from the current
scope only.

For the GCC case the workaround doesn't work in practice for this reason.

b '(anonymous namespace)::foo2'

works from any context (but is quite awkward due to tab-completion being
broken).

-- 
You are receiving this mail because:
You are on the CC list for the bug.


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