GDB Short Reference by Gary M. Zoppetti (Emphasis on x86 Assembly) ============================= Invoke gdb thus: gdb objectFile (make sure you compiled source code with -g switch) break [LOCATION] [if CONDITION] Set breakpoint (or watchpoint) at specified address display [EXP] Print value of expression EXP each time program stops Display all currently requested auto-display expressions with no args undisplay Cancel display requests previously made print EXP Print value of expression EXP x/FMT ADDRESS Examine memory address ADDRESS FMT is a format with repeat count followed by a format letter and a size letter run Start debugged program ni Step one instruction, but proceed through subroutine calls si Step one instruction exactly continue Continue program being debugged, after signal or breakpoint finish Execute until selected stack frame returns until Execute until the program reaches a source line greater than the current or a specified location within the current frame info reg List integer registers and their contents, for selected stack frame info break List status of user-settable breakpoints and watchpoints delete [breakpoints] Delete breakpoints info stack Show backtrace of the stack help Print list of commands disassemble Disassemble a specified section of memory Common Command Sequences ======================== break main display/i $pc run ni or si ... p/FMT $eax ... ni or si x/FMT address continue