gdb
: start gdb
file [file]
load a file
r [arg] [arg]
: run with argument
kill
: kill current program
b [arg]
: set a break point
function name
line number
sourceFile:lineNumber
n
: next
s
: step
finish
: step out
stepi
: step single assembly
c
: continue to next breakpoint
advance [function]
: continue to this temporary breakpoint
jump [i]
: jump to breakpoint
i b
: info of all break points
disable [num]
: disable specific break point
delete [num]
: delete break point
clear [nmae]
: delete break point by name of function
save breakpoints <filename>
: save break point
source <filename>
: load break point
disp [name]
: display content of variable by name
info display
: show display by number
undisplay [num]
: undisplay by number
print [name]
: print by variable name
printf "%08X\n", i
: printf
backtrace
: show stack
set (i = 20)
: set variable i to 20
watch [name]
: watch change of variable (write) by expression
rwatch
: detect variable read
awatch
: detect variable read + write
info watch
: see all watch point
call [expr]
: call expression
x/nfu
n: units of memory
f(format): either d(decimal), x(hex), s(string)
u(unit): either b(bytes), w(4 bytes), g(giant64)
x/i $pc
: see current line
(https://sourceware.org/gdb/current/onlinedocs/gdb/Registers.html)
TODO: valgrind arguments
Table of Content