...
- Attach to the target using GDB
- Set up breakpoints on the functions or lines I suspect
- Run the program until my breakpoints are hit
- Look at the function's parameters, local variables, and the stack trace for any anomalies
- 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.
...