Cherin's List of Useful gdb Commands
This list is a small subset of what gdb can do.
Some or all of these commands can be useful in disarming
your binary bombs.
-
Setting up breakpoints at a function
(gdb) break function_name
Here is an example
(gdb) break main
-
Example of setting up a breakpoint at a particular address
(gdb) break *0x8bffd5c0
-
Run your program.
It will stop at a breakpoint or for user input or at the end of the program.
(gdb) run
-
Execute one instruction
(gdb) stepi
-
Execute eight instructions
(gdb) stepi 8
-
Execute one instruction like stepi, but proceed through function calls
(gdb) nexti
-
Continue execution
(gdb) continue
-
Run until current function returns
(gdb) finish
-
Look at the contents of registers
(gdb) info registers
-
Examine the contents of a location in memory
(pre) x/x 0x8bffd5c0
Hint: use 'help x' to learn about the other formatting options with the
x command.
-
Gdb is a powerful tool. Learn more gdb commands to improve
your productivity. Use the 'help' command.