Main Debugger Operations
Here we give an overview of the main types of operations that a debugger offers.
Stepping Through the Source Code
You saw earlier that to run a program in GDB, you use the run
command, and that in DDD you click Run. In details to be presented later, you will see that Eclipse handles things similarly.
You can also arrange for execution of the program to pause at certain points, so that you can inspect the values of variables in order to get clues about where your bug is. Here are some of the methods you can use to do this:
- Breakpoints
-
As mentioned earlier, a debugging tool will pause execution of your program at specified breakpoints. This is done in GDB via the
break
command, together with the line number; ...
Get The Art of Debugging with GDB, DDD, and Eclipse now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.