Gdb
Jump to navigation
Jump to search
References
Compile with debug symbols
- Option -g:
gcc -g program.c # -g : debug symbols
GDB commands
- help
- Get help on commands
- run [ARGS]
- Start debugged program. Arguments may include wildcards (*) and redirections (<, <<...)
- backtrace [COUNT]
- bt [COUNT]
- where [COUNT]
- Print backtrace of all stack frames, or innermost (outermost) COUNT frames if COUNT>0 (COUNT<0)
- frame [FRAME]
- Select and print stack frame
- print VAR
- Print value of variable VAR
- kill
- Kill current program
- break FILELINE
- Insert a breakpoint at file FILE, line LINE
- next
- Step to next instruction