Use Application > Debug (or the toolbar debug button (
)) and Application > Interact (or the toolbar interact button (
)) to debug an executable (EXE) application.
These commands start the executable associated with the window, then pause its main thread and open a debugger window on that thread. If the application is already running, these commands pause the application in its current state.
If you want to start an application up in the debugger, so that you can examine its initial state, you want the application's library and the libraries it uses to initialize completely before the debugger pauses it. To do this, you need to specify the application's start function. A start function is a function that the application calls upon startup to set things running, such as a call to start an event loop in a windowing application. See "The project start function" on page 76 for details.
You can specify a start function on the Debug page of the Project > Settings... dialog. When you use Application > Debug or Application > Interact, the environment places a temporary breakpoint on the start function so that the application starts and then enters the debugger on entry to the start function. For this reason, the expression that calls the start function should appear after all definitions in the project, so that all definitions will be accessible in the debugger.
If the project does not specify a start function, the application will enter the debugger after all expressions are executed and the main thread is about to exit. In this case, the debugger is entered as the application has finished, which is not normally very useful. If you always specify a start function, you can pause the application at a more useful point.