Using gdb debug core_dump in cma

2019-10-11  本文已影响0人  大头菜turtle

龟龟是最可爱的猫

Using Cmake to generate gdb core file

in CMakeLists.txt:

set(CMAKE_BUILD_TYPE RelWithDebInfo)
set(CMAKE_BUILD_TYPE Debug)

then rebuild your project

Generate core file when meet a core dump

ulimit -c

if reult is '0', no coredump file will be generated

then :

ulimic -c unlimited

echo it into .bashrc to make it permanent

ulimit -c unlimited
cd /
mkdir corefile    ## corefile saving path
echo "/corefile/core-%e%-p%-%t" > /proc/sys/kernel/core_pattern    ##change corefile saving path

Using gdb to debug core dump

gdb [your_program] [core_file]
上一篇 下一篇

猜你喜欢

热点阅读