Debug a called subprocedure
- Last Updated: March 30, 2020
- 2 minute read
- OpenEdge
- Version 12.2
- Documentation
To debug a subprocedure called from the invoking procedure:
-
Optionally, define a logical variable you can use to assign the return
value for
DEBUGGERsystem handle methods. -
Add a
DEBUGGERsystem handle statement that invokes theINITIATE( )method before the point where you want to begin debugging the called subprocedure. This initializes the Debugger but does not immediately make it visible. -
Add a
DEBUGGERsystem handle statement that invokes theSET-BREAK( )method to set a breakpoint at the first executable line of the subprocedure you want to debug. This statement must execute after the statement that invokes theINITIATE( )method in the previous step, but before the statement that calls the subprocedure. - Run the invoking procedure.
The following listing fragment prompts the user to enter the name
(procname) of a procedure to debug (line 30). It then initializes the
Debugger (line 33) and sets a breakpoint on the first executable line of
procname (line 34). When the invoking procedure calls
procname (line 35), procname breaks immediately on its
first executable line and gives control to the Debugger. The Debugger then displays the
listing for procname in the Debugger window as the current procedure, as
shown:
|
_). In this case, the Debugger ignores
the invoking procedure completely, and it never appears on the call stack.Although this is a simple example, it illustrates the basic elements required to build an OpenEdge development tool that can start debugging sessions for specified application procedures.