美文网首页
Using gdb debug core_dump in cma

Using gdb debug core_dump in cma

作者: 大头菜turtle | 来源:发表于2019-10-11 14:47 被阅读0次

龟龟是最可爱的猫

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]

相关文章

网友评论

      本文标题:Using gdb debug core_dump in cma

      本文链接:https://www.haomeiwen.com/subject/fwgtmctx.html