If you want to debug a program that is already running, you can attach the debugger to the appropriate process.
Choose File > New Project.
In the New Project wizard, expand the Samples node and select the C/C++ category.
Select the Freeway Simulator project. Click Next and then click Finish.
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.
In the IDE, choose Debug > Attach Debugger.
In the Attach dialog box, type Freeway in the Filter field to filter the list of processes.
Select the Freeway process from the filtered list.
Click OK.
A debugging session is started and execution of the Freeway process pauses at the point where the debugger attached to it.
Click Continue to continue execution of Freeway, which is now running under control of the debugger. If you click Pause , execution of Freeway pauses, and you can examine variables, the call stack, and such.
Click Continue again and then click Finish Debugger Session . The debugger session ends, but the Freeway process continues executing. Choose File > Exit in the Freeway GUI to exit the application.