# 获取 program 的进程号 ps -ef | grep <program> # pid 是 program 的进程号 gdb -p <pid>
对无符号表可执行程序生成的 coredump 文件 debug
1
gdb -c <coredump_file> -e <exec_file>
参考
1 2 3 4 5 6 7
objcopy - copy and translate object files.
--only-keep-debug Strip a file, removing contents of any sections that would not be stripped by --strip-debug and leaving the debugging sections intact. In ELF files, this preserves all note sections in the output. --add-gnu-debuglink 创建 .gun_debuglink 字段并包含到符号文件的引用添加到目标文件中