最佳答案
在使用 gcc 或 Clang 编译 C 源代码时,我总是使用 -g标志为 gdb 生成调试信息。
gcc -g -o helloworld helloworld.c
我注意到有些人推荐使用 -g3。-g和 -g3标志的区别是什么?-g和 -ggdb之间有区别吗?