start
- start the program
p
- print values of variables (might use frame
to change the context)
x
- examine (print) low level data structers: memory, registers …
s
- step an instruction
n
- step over a function
display/i $pc
- Show the current instruction.
watch
- interrupt the program when the watched variable changes
rwatch
(?) - interrupt the program when the value of a variable is read
list
- show the program source code (if compiled with -g
)
break
- set a breakpoint
bt
- backtrace
set var varName = 42
- set the value of varName
to 42.
tui enable
: start TUI mode (Text User Interface).
quit
set disassembly-flavor intel
-M
option of objdump
chooses the assembly dialect.
.intel_syntax noprefix
in the GNU assembler (as
) (gdb) python print(gdb.breakpoints()) (gdb) python print(gdb.breakpoints()[0].location)
ptrace
to debug a program.