GDB

GDB has some useful debugging features that could speed up your workflow or give more thorough debugging information.

Conditional Breaks

We could set a conditional breakpoint using the syntax below:

break myfile.c:20 if (var == 30)

GDB will stop there if the variable var in the scope is equals to 30 when it reached the line number 20 in the file myfile.c

This will accelerate our debugging speed and filter other unwanted states as much as possible.

Backtrace Verboseness

We could adjust how verbose the information that the command backtrace should show by setting the value to two variables: frame-arguments and frame-info.

Links to this page
  • Debugging Tools
    Data Display Debugger (DDD), a graphical front-end for multiple debuggers such as GDB#, DBX, WDB, Ladebug, JDB, XDB, the Perl debugger, bashdb, remake, and pydb.
    GDB# (??)
    GDB# especially with -g3 option for more verbose debugging information.
#debugging #c #cpp