Gdb
ph
- gdb tutorial with FAQ
- debugging under unix (Richard M. Stallman and Roland H. Pesch)
- debugging with gdb 9th edition
- summary of commands (from here)
Gdb Command | Description |
---|---|
set listsize n | Set the number of lines listed by the list command to n [set listsize] |
b function | Set a breakpoint at the beginning of function [break] |
b line number | Set a breakpoint at line number of the current file. [break] |
info b | List all breakpoints [info] |
delete n | Delete breakpoint number n [delete] |
r args | Start the program being debugged, possibly with command line arguments args. [run] |
s count | Single step the next count statments (default is 1). Step into functions. [step] |
n count | Single step the next count statments (default is 1). Step over functions. [next] |
finish | Execute the rest of the current function. Step out of the current function. [finish] |
c | Continue execution up to the next breakpoint or until termination if no breakpoints are encountered. [continue] |
p expression | print the value of expression [print] |
l optional_line | List next listsize lines. If optional_line is given, list the lines centered around optional_line. [list] |
where | Display the current line and function and the stack of calls that got you there. [where] |
h optional_topic | help or help on optional_topic [help] |
q | quit gdb [quit] |
- debugging with gdb Good*3