Just-in-time debugging
If you are running your application in regular mode (using the
Run button) and you notice that the application is behaving
incorrectly, just-in-time debugging lets you switch to debug mode
without terminating the application.
When you open the debugger while running an application, the
application does not stop executing. The Source, Variables, Call
Stack, and Objects in Memory views are all empty because the debugger
does not have any context. To suspend execution and examine the
context in a problem area, open an appropriate script and set
breakpoints, then initiate the action that calls the script.
If just-in-time debugging is enabled and a system error occurs
while an application is running in regular mode, the debugger opens
automatically, showing the context where the error occurred.
You can also use the DebugBreak function to break into the
debugger.
You must enable just-in-time debugging before you run your
application to take advantage of this feature.
To enable just-in-time debugging
-
Select Tools>System Options.
-
Check the Just In Time Debugging check box and click
OK.
To debug an application while running in regular mode
-
Enable just-in-time debugging.
-
Run the application.
-
Click the PowerBuilder button on the Windows Taskbar.
-
Click the Debug button in the dialog box that
displays. -
Open a script in the Source view and set breakpoints.
The application is suspended when it hits a breakpoint and
the Source, Variable, Call Stack, and Objects in Memory views show
the current context. You can now debug the application.