Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
是否有任何 GDB 命令来获取可执行文件路径?目前它显示
Core was generated by ./a.bin
但我不想 grep 结果。有没有办法使用 GDB 命令获取生成的路径。
核心由 ./a.bin 生成
请注意,大多数操作系统对可记录在NT_PRPSINFOELF 注释中的可执行路径的长度有相当短的限制(在 Linux 上,限制为 16 个字符)。
NT_PRPSINFO
有没有办法使用 GDB 命令获取生成的路径。
我不相信。
编写一个程序在 中查找PT_NOTE段core,然后解码(可变大小)ELF 注释,直到找到该注释,NT_PRPSINFO然后您可以打印pf_fname.struct prpsinfo
PT_NOTE
core
pf_fname
struct prpsinfo
但鉴于那里的信息可能会被截断,不清楚为什么要编写这样的程序。