doronAtuar
12/31/2017 - 9:50 AM

gdb quickstart

#compiling with symbols
-g -O0 # or dont specify -O option at all

# run command with gdb attached
gdb --args <command> <arg1> <arg2> ...

#navigation
next (n)
continue (c)
step <stepin>
fin (stepout)
until <location>

#stack frame /call stack navigation
f <# of frame>
up
down

#printing
p <var name>
p *array@len
x/<len>w array

#breakpoint on variable change
watch <expression>

#execute command when break point hit
breakpoint <regular breakpoint syntax>
command
<commands to exexute>
end

#stepping over a loop
u/until (hit until when on the loop decleration)