Progress
Debugger Guide
Starting in Stand-alone Mode
This technique is useful for running the Debugger as a tool started from one application to debug other applications. The invoking procedure runs the Debugger much like a subroutine, but does not specify any procedure for the Debugger to run as its initial current procedure. You must run all procedures you want to debug from the Debugger after it starts using the RUN command.
Invoking the Debugger As a Tool of Your Application
To start the Debugger from the 4GL while blocking the invoking procedure, follow these steps:
In the following example, the procedure presents six execution options, each of which invokes a different procedure. However, if you choose an invalid option, the procedure invokes the DEBUG( ) method and blocks at the following statement (line 29) while the Debugger runs:
When the Debugger first starts, it lists the invoking procedure, with the line pointer on the line that contains the blocked statement. Entering a control flow command (such as NEXT) to execute the blocked statement (the MESSAGE statement in the example) has no effect because the invoking procedure is not running in the Debugger context.
As a result, while the invoking procedure waits on the blocked statement, the Debugger runs on its own allowing you to control any other procedure that you start from it.
NOTE: Typically, you do not want to provide any indication of the invoking application in the Debugger window for this type of application. You can suppress the listing of the invoking procedure in the Debugger window by prepending the procedure name with an underscore ( _ ). In this case, the Debugger starts up with a clear listing panel, ignoring the invoking procedure completely.When you exit the Debugger, it returns control to the invoking procedure, which continues execution from the blocked statement (line 29 in the example). In stand-alone mode, you cannot otherwise access the invoking procedure until the Debugger returns control.
Starting a Stand-alone Debugger from the Procedure Editor
This technique is an alternative to running the Debugger from the Procedure Editor using the Compile menu. When you start the Debugger using the Compile menu, the Editor starts the Debugger in application mode, passing it the current buffer as the initial executing procedure. (For more information, see Starting and Stopping the Debugger.") This technique starts the Debugger directly from the Editor in stand-alone mode by invoking the DEBUG( ) method as part of a two-line procedure:
When you run this procedure, the Debugger starts and takes control immediately, without any current procedure in the Debugger context. You must run all application procedures from the Debugger using the RUN command. When an application completes execution, it returns to the Debugger, and when you exit the Debugger, it returns to the Editor. This is useful when you want to work from the Editor and debug several different applications without leaving the Debugger.
Copyright © 2004 Progress Software Corporation www.progress.com Voice: (781) 280-4000 Fax: (781) 280-4095 |