[转载]gdb使用初步
2007-09-10 09:17
274 查看
首先,你的程序在经由gcc/g++编译的时候,要带上-g选项。比如:g++ test.cpp -g -o test
然后,执行:gdb test
进入gdb界面之后,输入start并回车,则调试开始。(如果被调试的程序需要参数,则在start后面带参数)
以下是常用命令:
help: display help. you can use 'help data', 'help running' for more help
start: start running and suspend
run: start running
n: next
s: step into
c: continue
b: set breakpoint
cl: clear breakpoint
info breakpoints: list all breakpoints
p: print value
disp: keep watch on value
undisp: no longer keep watch on value
where: show stach trace
thread: switch thread
ctrl+c: suspend debug running
list: display source code
然后,执行:gdb test
进入gdb界面之后,输入start并回车,则调试开始。(如果被调试的程序需要参数,则在start后面带参数)
以下是常用命令:
help: display help. you can use 'help data', 'help running' for more help
start: start running and suspend
run: start running
n: next
s: step into
c: continue
b: set breakpoint
cl: clear breakpoint
info breakpoints: list all breakpoints
p: print value
disp: keep watch on value
undisp: no longer keep watch on value
where: show stach trace
thread: switch thread
ctrl+c: suspend debug running
list: display source code
相关文章推荐
- GDB调试精粹及使用实例 转载
- (转载)gdb使用方法
- [转载]使用SOLARIS的初步设置
- gdb使用初步
- [转载] GDB使用
- GDB的初步使用学习
- 在 Python 中使用 GDB 来调试 转载
- [转载]Makefile使用初步
- GDB 使用详解-----转载
- Redis进阶实践之七Redis和Lua初步整合使用(转载 7)
- GDB的使用(转载)
- <转载>linux gcc编译器中使用gdb单步调试程序,程序不是顺序执行的。
- 转载_使用DDD+GDB开发ARM Linux程序
- GDB调试精粹及使用实例(转载)
- 转载_Linux core dump file详解及使用GDB调试Coredump文件
- ARM - PcDuino 初步使用- 挂载网络文件系统-【转载】
- GDB调试精粹及使用实例(转载)
- 转载:使用 GDB 恢复堆栈信息
- 使用GDB生成coredump文件【转载】
- GDB调试精粹及使用实例(转载)