我如何获取源代码路径&& ELF文件中的文件名(与-g兼容)? [英] how can i get the source code path && file names from an ELF file(compired with -g)?
本文介绍了我如何获取源代码路径&& ELF文件中的文件名(与-g兼容)?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想获取源代码路径&&只是通过ELF文件获得的源名称, .debug_str 部分包含了我所需要的,但是我该如何过滤掉它们?
I want to get the source code path && source names just through the ELF file, the .debug_str section contains what i need, but how can i filter them out?
推荐答案
$ readelf --string-dump=.debug_str YOUR_PROGRAM
可以正常工作。
但是,请确保未使用命令删除your_program
However, make sure your_program is not stripped by using command
file YOUR_PROGRAM
这篇关于我如何获取源代码路径&& ELF文件中的文件名(与-g兼容)?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文