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.
- 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()