GDB Stacktrace for optimized code!

Thamil K thamilk@gmail.com
Tue Apr 20 05:55:18 GMT 2021


Hi Geeks,

For programs compiled with -O2, where the compiler uses 'jmp' where
possible instead of 'call' or where callee doesn't push $rbp onto the
stack, gdb is still able to generate stack trace properly.  But by
inspecting the $rbp and return address, I am unable to trace back the
calls. I would like to know how gdb synthesises the stack trace ?  Any
pointers on documentation?   Thanks in advance.

Thanks
Thamil


More information about the Gdb mailing list