开发者

How to get non-dynamic symbols in GCC backtrace?

开发者 https://www.devze.com 2023-02-10 22:29 出处:网络
GCC\'s 开发者_运维百科backtrace_symbols() only resolves dynamic symbols, since handling all types of symbols is something GCC maintainers do not want to get into.

GCC's 开发者_运维百科backtrace_symbols() only resolves dynamic symbols, since handling all types of symbols is something GCC maintainers do not want to get into.

How would I go about extracting non-dynamic symbols obtained from GCC's backtrace() function myself?


Check out what addr2line does using bfd. That is one approach I have used successfully. More specifically, backtracefilt gets you basically all the way there, you just need to adapt it to take the addresses from backtrace instead of parsing a file.


libdw, part of elfutils, can be used to read the DWARF debugging information that is present if you compiled with -g.

0

精彩评论

暂无评论...
验证码 换一张
取 消