作为内置和最常用的调试器,GDB 显然有着无可辩驳的地位。熟练使用 GDB,就好像所有 Linux 下的开发人员建议你用 VIM
一样,是个很 "奇怪" 的情节。 测试用源代码。 #include int test(int a, int b) { int c =
a + b; return c; } int main(int argc, char* argv[]) { int a =
0x1000; int b = 0x2000; int c = test(a, b); printf("%d\n", c);
printf("Hello, World!\n"); return 0; } 编译命令 (注意使用 "-g" 参数生成调试符号): $
gcc -g -o hello hello.c 开始调试: $ gdb hello GNU gdb 6.8-debian
Copyright (C) 2008 F...
阅读全文>>