gdb常用命令
2018-11-06 本文已影响0人
嵌入式工作
1gdb编译方法:
gcc -g xxx.c -o xxx

2进入gdb调试
gdb ghello

3l(list)查看文件,每次输入l显示10行

4设置断点,设置方法:b 7,第7行设置断点

5 info b 查看断点情况

6 r(run)命令,默认是从开头执行,可以加上行号,从指定行开始

7p(print)查看变量的值

gcc -g xxx.c -o xxx
gdb ghello