Go to main content
Oracle® Developer Studio 12.5: IDE Quick Start Tutorial

Exit Print View

Updated: June 2016
 
 

Debugging a Running Program by Attaching to It

If you want to debug a program that is already running, you can attach the debugger to the appropriate process.

  1. Choose File > New Project.

  2. In the New Project wizard, expand the Samples node and select the C/C++ category.

  3. Select the Freeway Simulator project. Click Next and then click Finish.

  4. Right-click the Freeway_1 project you created and choose Run. The project builds and the Freeway application starts. In the Freeway GUI window, choose Actions > Start.

  5. In the IDE, choose Debug > Attach Debugger.

    image:Attach dialog box
  6. In the Attach dialog box, type Freeway in the Filter field to filter the list of processes.

  7. Select the Freeway process from the filtered list.

  8. Click OK.

  9. A debugging session is started and execution of the Freeway process pauses at the point where the debugger attached to it.

  10. Click Continue image:Continue buttonto continue execution of Freeway, which is now running under control of the debugger. If you click Pause image:Pause button, execution of Freeway pauses, and you can examine variables, the call stack, and such.

  11. Click Continue again and then click Finish Debugger Session image:Finish Debugger Session button. The debugger session ends, but the Freeway process continues executing. Choose File > Exit in the Freeway GUI to exit the application.