layout | title | permalink |
---|---|---|
page |
GDB cheat sheet |
/gdb/ |
If you have the source, compile with -g to enable debug information, gdb then has access to the source code.
i r
(info registers)
r
r < input_file
r -x -y -z blabla
b main (needs symbols)
b *0x08041234
c
ni/nexti (treats a 'call' as one instruction)
si/stepi (also steps into the callee)
next (needs -g, next source line)
step (needs -g, next source line)
x/32wx $esp
x/16gx 0x08049876
x/f $eax (float)
x/20i main (disassemble)
b byte
h 16bit word
w 32bit word
g 64bit word
bt
(backtrace)
info proc mappings
!ls
list main
display/i $eip