How to avoid namespace prefix for characters in GDB?

I am working with a C ++ library. The library uses several namespaces. When debugging, I have to prefix each symbol name with a namespace prefix. This causes a lot of extra work and input.

C ++ has a concept using namespace Xto make characters accessible with greater ease (many manual failures). I am looking for similar ones in gdb. For example, instead b MyLibNamespace::Foo::bar, I want b Foo::bar.

GDB doesn't have namespace related support, but I probably have 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 need to provide it for every character name?

+6
source share
2

GDB , ?

GDB ( 2017-08-13) .

, Python . .

, .

0

GDB , ?

...

() ​​ (++) . (.cc), ().

, .

"" ( d1(), d2() ..)

, . , .

, edit/compile/link : gdb, , , gdb. "" . , .

( ). , , .


... ...

gdb Foo_t, DTB .. d1 , Foo_t (- ) Foo . , d1 :

void d1() { objDer.f("xxx"); } // a derived instance,
//                             the class has a long complex name.

, gdb, -, , gdb print d1...

(gdb) p d1()

short gdb, .

0

All Articles