How to avoid namespace prefix for symbols in GDB?

Viewed 1806

I'm working with a C++ library. The library uses several namespaces. When debugging, I have to prefix every symbol name with the namespace prefix. It causes a lot of extra work and typing.

C++ has the using namespace X concept to make symbols available with more ease (lots of hand waiving). I'm looking for similar in GDB. For example, instead of b MyLibNamespace::Foo::bar, I want to b Foo::bar.

GDB does not appear to have help related to namespaces, but I'm probably doing something wrong:

(gdb) help namespace
Undefined command: "namespace".  Try "help".
(gdb) namespace help
Undefined command: "namespace".  Try "help".

How do I tell GDB to use a namespace prefix so I don't have to provide it for every symbol name?

2 Answers
Related