gdb利用core文件来定位segmentation error

1. make -g **

- add -g option to enable gdb debug.

2. ulimit -c unlimited

- Enable coredump file to be created when segmentation fault occurs.

3. Gdb ./bin core.xxxx

- Get the core dump info. By the gdb

4. bt/backtrace

- Back trace the point that program gets segmentation fault

5. q/quit

- Leave GDB

猜你喜欢

转载自www.cnblogs.com/biggerjun2015/p/12322371.html