Printing full backtrace in C ++

I want to reset the return line from a C ++ program on Linux in the same format as gdb. I tried using the backtrace () and backtrace_symbols () functions for this purpose. These return function names and offsets. I can use the __cxa_demangle () function to get a readable function name.

Is there a way to get file / line positions, how is this done with gdb?

+5
source share
1 answer

What is the best way to call gdb from a program to print its stacktrace? `

Methode # 4 shows how to get the file name and string. But uses an external program.

+5
source

All Articles