how to strip debug info

发布时间 2023-05-26 15:50:28作者: stdpain

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`