Lab 1 - GDB


gdb: start gdb file [file] load a file r [arg] [arg]: run with argument kill: kill current program


b [arg]: set a break point

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

Breakpoint Setting

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

Variable Manipulation

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

Byte Code


x/i $pc: see current line (

TODO: valgrind arguments

Table of Content