This topic describes common tasks you can perform when debugging a
C or C++ project. For more
detailed information, click the links in the right column.
To perform this task |
Follow these steps |
Start a debugging session
|
-
To debug the selected project, choose Debug >
Debug Project
or click the Debug Project toolbar button
.
-
To debug any individual project, right-click the project and choose
Debug.
-
To debug a core file, choose Debug > Debug Core File,
and specify the host, core file,
executable, and project in the Debug Core File dialog box.
-
To attach the debugger to a running process, choose Debug > Attach Debugger.
|
Finish a debugging session.
|
-
To finish the current session, choose Debug >
Finish Debugger Session (Shift-F5) or click the Finish Debugger Session toolbar
button
.
- To finish any session, open the Sessions window (Alt-Shift-6),
right-click the session, and choose Finish.
|
Set a line breakpoint.
|
- In the Source Editor,
click in the left margin next to the desired line.
|
Set a function or instruction breakpoint.
|
- In the Source Editor or the Disassembly window, select the function or instruction
on which you wish to set a breakpoint.
- Choose Debug > New Breakpoint (Ctrl-Shift-F8).
- In the New Breakpoint dialog box, select the breakpoint type, set
any required options, and click OK.
|
Modify breakpoint properties.
|
-
Open the Breakpoints window (Alt-Shift-5).
-
Right-click the breakpoint and choose Customize.
-
Change any required settings and actions and click OK.
|
Set a watch
|
- In the Source Editor, right-click a variable or expression and
choose New Watch (Ctrl-Shift-F7)..
|
Pop the most recent call from the call stack.
|
- Right-click in the Call Stack window and choose Pop
Topmost Call.
|
Pop multiple calls from the call stack
|
-
Open the Call Stack window (Alt-Shift-3).
-
Right-click the call that you want to remain at the
top of the call stack.
- Choose Pop to Here.
|
Browse information for calls on the call stack.
|
- To move down the call stack, choose Debug
> Stack > Make Callee Current (Ctrl-Alt-up arrow).
- To move up the call stack, choose Debug > Stack >
Make Caller Current (Ctrl-Alt-down arrow).
- To make a call current, right-click the call in the
Call Stack window and
select Make Current.
|