objycopy只拷贝调试信息
objcopy --only-keep-debug main main.debug
Strip debug information from origin file:
objcopy --strip-debug main
or
strip --strip-debug --strip-unneeded main
添加调试信息
objcopy --add-gnu-debuglink main.debug main
gdb使用调试信息文件
(gdb) exec-file main (gdb) symbol-file main.debug
https://stackoverflow.com/questions/866721/how-to-generate-gcc-debug-symbol-outside-the-build-target