CS 202 - Notes 2016-04-06

Debugging with GDB

A good starting place is Professor Johnson’s guide to GDB. This will give you a good run down on the basic commands.

We have a couple of commands that are useful to us that are not included in that guide.

nexti (ni) & stepi (si)

The next and step commands only work when debugging data is included in the file and they operate on the level of lines of C code. nexti and stepi, on the other hand, work at the instruction level, allowing us to walk through the code one instruction at a time. As with next and step, nexti will “step over” the call instruction, while stepi will follow the jump into the function.

Recommendation for assembly level debugging