What's your method for finding the cause of a segfault?

后端 未结 6 414
不知归路
不知归路 2021-01-14 07:51

Or just debugging in general, how do you like to go about finding bugs in code. Specifically for C/C++, but all languages in general. I\'ve been trying to find the cause of

6条回答
  •  滥情空心
    2021-01-14 07:54

    1. Compile with debug flash of GCC
    2. Launch gdb with your exe
    3. r (with arguments if needed)
    4. bt

    This solution usually permit to identify the segfault and his cause.

提交回复
热议问题