2016-06-19から1日間の記事一覧

GDB使用方法

例子程序tst.c #include <stdio.h> void main() { int i; long result = 0; for ( i=1; i <= 100; i++) { result += i; } printf("result = %d\n",result); } 1.首先编译程序tst.c生成可执行程序tst gcc -g tst.c -o tst 2.启动GDB gdb tst 3.在main处设置断点 (b=bre</stdio.h>…