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.
- Post title: GDB
- Create time: 2023-05-25 17:34:01
- Post link: 2023/05/25/note/Wiki/GDB/
- Copyright notice: All articles in this blog are licensed under BY-NC-SA unless stating additionally.
Show Comments