Activating the Debugger

Top  Previous  Next

 

In order to debug a script the debugger must be activated.  There are four ways to activate the debugger.  In all cases the SetStartup EnableDebugger command must be set to “Yes” to activate the debugger.

The Debug Statement

Including the DEBUG statement in a script will cause the script to stop processing and start the debugger in the EMUE User Interface window.  This will occur every time the DEBUG statement is encountered in the processing of the script. This is helpful when debugging a section of a new script.

Debug Next

Clicking on the Debug Next button or the Debug button on the upper right hand side of the EMUE window below the mainframe portion, will cause EMUE to immediately stop script execution and activate the debugger. The current command will complete execution before the debugger is activated.

Setting a Breakpoint

While a script is not running (either before starting, or while in debug-mode), a breakpoint can be set on a script line.  When EMUE encounters a breakpoint on a script line, EMUE pauses the processing of the script and activates the debugger prior to processing that script line.  There can be multiple breakpoints set within a script.  A breakpoint can be set on a line by moving the cursor to the desired line and clicking the “Toggle Breakpoint” button, by right clicking on the script line and selecting “Toggle Breakpoint” from the context menu or by clicking in the gutter to left of the line number

Encounter a runtime error

If a runtime error occurs and the SetStartup EnableDebugger command is set to “Yes”, EMUE automatically activates the debugger. This provides the capability to correct the issue that caused the error and then the script can be restarted from an appropriate line in the script.

 

Note: If SetStartup EnableDebugger command is set to "No", or the user interface is set to not enable the debugger, a runtime error will halt execution with an error message, and not activate the debugger.