gdb使用初步
2006-07-04 21:09
537 查看
首先,你的程序在经由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使用初步
- GDB的初步使用学习
- gdb使用手册
- eclipse下使用cygwin的方法(Windows下用eclipse玩gcc/g++和gdb)
- Netty使用初步
- MySQL基础(一)MySQL安装及初步使用
- 初步学习和使用SQL Developer
- gdb 调试使用
- EventBus使用详解(一)——初步使用EventBus
- git的初步使用
- VC++6.0调试工具使用初步
- tensorflow学习之七:初步使用tensorboard
- 使用gdb调试程序
- Qt自定义控件的创建与初步使用(二)之图片上绘制文字、箭头、曲线
- git 使用初步
- 操作系统实验五:保护模式之初步认知门任务(求助:如何使用其他指令替代或模拟retf指令)
- Qt学习之路_4(Qt UDP的初步使用)
- 初步使用GCD
- FileUpload控件使用初步