Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  1. Attach to the target using GDB
  2. Set up breakpoints on the functions or lines I suspect
  3. Run the program until my breakpoints are hit
  4. Look at the function's parameters, local variables, and the stack trace for any anomalies
  5. Continue execution and repeat until I've found the problem

Useful Commands

Info

Keep in mind that this isn't an exhaustive list, just some commands that I find myself using a lot. GDB has many more abilities, including support for Python scripting!

Fun fact: GDB can handle short forms of commands. For example, bt instead of backtrace. GDB also supports tab completion for pretty much everything.

...