gdb文档表示编译目录可以记录在可执行文件https://sourceware.org/gdb/current/onlinedocs/gdb/Source-Path.html中。
可执行程序有时不记录编译源文件的目录,只记录名称。即使这样,目录也可以在编译和调试会话之间移动。
假设可执行文件记录编译目录。如何打印编译目录?
发布于 2020-04-01 22:38:07
就像这样:
cd /tmp
gcc -g t.c
readelf -Wwi a.out | grep DW_AT_comp_dir
<15> DW_AT_comp_dir : (indirect string, offset: 0x2ab): /tmp
https://stackoverflow.com/questions/60969020
复制相似问题