I have a shared object file that has DWARF info. I want to find the offset of a function. My stack trace is in the format mangledFuncName + 0x123
. I want to find the line of code for the corresponding frame. Ideally I'd like to build some sort of mapping between all offsets of a .so file and the filename/linenumber for the offset/range of offsets. Is this possible to do with gdb?
gdb <so or file loading so>
(gdb) b main
(gdb) run
(gdb) p youfun
(gdb) info line *(0xabcdef+0xab)
(gdb) list *(0xabcdef+0xab)
(gdb) info symbol 0xabcdef
(gdb) b *(0xabcdef+0xab)
.so
file load.
It is not needed if you have the debug info loaded already
(file
or as gdb argument).0xabcdef
with the address of the function and 0xab
with the offsetIf you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With