c gdb demo

#include <stdio.h>

void test_core1() {
    int i = 0;
    scanf("%d", i);
}

void test_core2() {
    char *name = "guanxianseng";
    *name = 0;
}

int main() {
    test_core1();

    return 0;
}

1. 开启core    ulimit  -c unlimited, ulimit命令为0,表示不会生成core

编译开启调试-g, 当前目录会生成core

 

posted on 2020-03-01 16:57  luckygxf  阅读(116)  评论(0编辑  收藏  举报

导航