Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Using gdb with inlined functions

Tags:

I'm trying to use gdb in postmortem mode with the core dump of a crashed process. I can get a stack trace, but instead of showing me the actual location in the offending function, gdb shows me the line number of a two-line inlined function that the offending function calls.

The inlined function is called many, many places; how do I find which call triggered the crash? How do I find the code immediately around the inlined function?

like image 330
Josh Kelley Avatar asked Feb 13 '09 15:02

Josh Kelley


1 Answers

Go to the stack frame in question, print the instruction point (e.g. p $rip), then use it to look it up manually with e.g. "addr2line -e -i 0x84564756".

This doesn't scale, but at least it works.

like image 58
Rupert Avatar answered Sep 30 '22 17:09

Rupert