GDB 的使用
Compile the source file to the binary file.
Add argument -g
to generate a GDB binary file.
gcc -g source.c -o output |
Command | Full name | Do somthing |
---|---|---|
gdb output |
||
r |
run |
Run current program |
b |
break |
Set a breakpoint at [function] or [line] (in file ) |
c |
continue |
Continue running your program (after stopping, e.g. at a breakpoint). |
n |
next |
Execute next program line (after stopping); step over any function calls in the line. |
s |
step |
Execute next program line (after stopping); step into any function calls in the line. |
l |
list |
Type the text of the program in the vicinity of where it is presently stopped. |
p |
print |
Display the value of an expression. |
watch |
watch |
Set a watchpoint in an address of expression |
i b |
info break |
Check information of breakpoints. |
k |
kill |
Kill the program being debugged. |
q |
quit |
Exit from GDB. |
- You can use
shell [args]
to execute a shell command.
- 本文标题:GDB 的使用
- 创建时间:2023-05-25 17:34:01
- 本文链接:2023/05/25/note/Programming/evn/GDB/
- 版权声明:本博客所有文章除特别声明外,均采用 BY-NC-SA 许可协议。转载请注明出处!
显示评论