GNU gdb for C++ applications

For C programmers, using GDB for C++ applications could be daunting task. I have learned following lessons:

    • Always pass fully qualified name of a function such as namespace_1::class_1::function1
    • You can’t put a breakpoint on a template function.
jango::IndexInterface<jango::treedata_v1>::toIndex
      • The easiest way is to put the breakpoint on the line number of the template function.
    • C++ application’s core is legible if you interpret it ignoring name mangling of functions.
_ZN5ns_111class_a6functionB2EPKcPKvibbbPb+0x15ca 
 ==> ns::class_a::functionB()
Advertisements

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s