First page Back Continue Last page Overview Graphics
Gdb - The GNU Debugger
A powerful command line debugger
Frontends available:
- ddd - Data Display Debugger - graphical and very good for complex data structures
- Insight - another graphical frontend
- Emacs has interface
Compile source with -g for debug symbols
Notes:
While 'gdb' is command line based there are lets of graphical interfaces. In particular 'ddd' is really useful for examining complex data structures.
Gdb is most useful when your code is compiled with the '-g' flag (on gcc) which causes the compiler to add extra information to the executable; saying which bits of code correspond to which lines of source. Note this can get confusing when optimisation is also on.
So compile the example program 'seggy.c' with:
gcc -g seggy.c -o seggy