您的位置:首页 > 其它

how can i get the source code path && file names from an ELF file(compired with -g)?

2017-12-16 20:28 666 查看
https://stackoverflow.com/questions/31333337/how-can-i-get-the-source-code-path-file-names-from-an-elf-filecompired-with

readelf
holds the key, but you don't want to dump strings willy-nilly. Use the
-wi
option to properly format the info.
For example, create a shell script thus:

readelf -wi $1 | grep -B1 DW_AT_comp_dir | \
awk '/DW_AT_name/{name = $NF; getline; print $NF"/"name}'

which further summarizes the output of
readelf -wi
.
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐