The Debug perspective contains many controls for tracing the program's execution and examining its state.
Here, we summarize the controls shown in the default views of the perspective and provide the names of the
C/C++ Development User Guide sections that explain them in full.
- Tracing program execution
- ()
-
The Debug view displays the active debugging sessions and for each session,
the hierarchy of program components, from the process level to the stack frames of individual threads.
Clicking a program component updates the information shown in other views in the Debug perspective.
-
The buttons along the top support actions that include but aren't limited to:
- Resume () — resume execution of the currently suspended program
- Suspend () — halt execution of the thread currently selected
in the program listing
- Terminate () — end the selected debugging session and/or program;
the impact of this action depends on what type of component is selected
- Step Into () — execute the current line, including code inside of any
routines, and proceed to the next statement
- Step Over () — execute the current line, skipping execution inside of any
routines
- Step Return () — continue execution to the end of the current routine, then
follow execution to the routine's caller
CAUTION:
It is not recommended to detach the debugger by clicking the Disconnect button (
).
This action sometimes causes the process to abruptly terminate with a nonzero exit code. For example, if you
have a
sleep() call, the process typically aborts when it reaches that line after you
detached the debugger.
- Accessing variables
- ()
-
In the Variables view (shown in the upper right area), you can display and change variable
values for the selected stack frame.
- Managing breakpoints
- ()
-
You can add breakpoints through the editor, by double-clicking the left margin next to a line of code.
When you do so, the new breakpoint appears in the Breakpoints view. This view lets you enable
or disable breakpoints using checkboxes, and remove and skip them using the right-click menu.
- Working with registers
- ()
-
The Registers view displays the register contents for the selected stack frame,
and lets you change their values.
- Viewing loaded modules
- ()
-
The Modules view displays the executable and libraries loaded for a debugging session.
You can access more debugging controls through nondefault views; for instance,
the Memory view lets you monitor and change process memory.
For the list of debugging views, select in the IDE.
For general information on all debugging capabilities of the IDE, see .