Line number of segmentation fault

前端 未结 8 1003
误落风尘
误落风尘 2020-12-13 08:56

Is there any gcc option I can set that will give me the line number of the segmentation fault?

I know I can:

  1. Debug line by line
  2. Put printfs in
8条回答
  •  轮回少年
    2020-12-13 09:05

    you also need to build with debug flags on -g

    You can also open the core dump with gdb (you need -g though).

提交回复
热议问题