6.9 Debugging programs

To debug a program, it must be compiled with debug information. Compiling a program with debug information allows you to:

  1. Execute the program line by line.
  2. Run the program up to a certain point (a breakpoint).
  3. Inspect the contents of variables or memory locations while the program is running.

  6.9.1 Using breakpoints
  6.9.2 Using watches
  6.9.3 The call stack
  6.9.4 The GDB window