开发者

how to make sure a program or shared library is compiled with -g, in linux

开发者 https://www.devze.com 2023-04-12 22:08 出处:网络
I want to make sure my execute program is debug开发者_高级运维-able, what command can get the infomation.I am a fan of using file to get information on executables and shared libraries.

I want to make sure my execute program is debug开发者_高级运维-able, what command can get the infomation.


I am a fan of using file to get information on executables and shared libraries.

The one key you are looking for is stripped in the description. If it is stripped it definitely does not have your debug symbols. Sadly, I am thinking a binary can still have no debug info but not be stripped.

$ file /usr/bin/file
/usr/bin/file: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.15, stripped


You can use objdump with the --debugging and --debugging-tags options

0

精彩评论

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

关注公众号