C and C++ Debugging Tasks: Quick Reference

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 Debug Project 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 Finish Debugger Session 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.
  1. In the Source Editor or the Disassembly window, select the function or instruction on which you wish to set a breakpoint.
  2. Choose Debug > New Breakpoint (Ctrl-Shift-F8).
  3. In the New Breakpoint dialog box, select the breakpoint type, set any required options, and click OK.
Modify breakpoint properties.
  1. Open the Breakpoints window (Alt-Shift-5).
  2. Right-click the breakpoint and choose Customize.
  3. 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
  1. Open the Call Stack window (Alt-Shift-3).
  2. Right-click the call that you want to remain at the top of the call stack.
  3. 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.

Copyright © 2015, Oracle and/or its affiliates. All rights reserved.