how to strip debug info

compile:

c++ -g tmp.cc -o starrocks_be

split debug info

objcopy --only-keep-debug starrocks_be starrocks_be.debug
strip --strip-debug starrocks_be

link debug info with striped binary

objcopy --add-gnu-debuglink=starrocks_be.debug starrocks_be

optional

gdb -s starrocks_be.debug -e starrocks_be -c `core_file`
posted @ 2023-05-26 15:43  stdpain  阅读(19)  评论(0编辑  收藏  举报