Previous Next

DEBUGGER system handle
A handle that lets ABL procedures initialize and control the Application Debugger.
To use the DEBUGGER handle, you must have the Application Debugger installed in your OpenEdge environment.
Note:
Syntax 
 
DEBUGGER [ :attribute | :method ]
attribute
Specifies an attribute of the DEBUGGER handle.
method
Specifies a method of the DEBUGGER handle.
Attributes
 
Methods
 
Examples 
The following example displays Orders for each Customer in the Sports2000 database using two procedure files. The r-cusbug.p file initializes the Debugger and sets a breakpoint at line 6 of the r-ordbug.p file. Thus, each time r-ordbug.p displays an Order, the Debugger takes control before it displays the Order Lines. Just before completing execution, r-cusbug.p clears the debugging session before returning.
 
DEFINE NEW SHARED BUFFER CustBuf FOR Customer.
 
DEFINE VARIABLE debug AS LOGICAL NO-UNDO.
 
debug = DEBUGGER:INITIATE().
debug = DEBUGGER:SET-BREAK("r-ordbug.p",6).
 
FOR EACH CustBuf NO-LOCK:
  IF CAN-FIND(Order OF CustBuf) THEN
    RUN r-ordbug.p.
END.
 
debug = DEBUGGER:CLEAR().
 
DEFINE SHARED BUFFER CustBuf FOR Customer.
 
FOR EACH Order OF CustBuf NO-LOCK:
  DISPLAY CustBuf.Name CustBuf.CustNum CustBuf.City CustBuf.State
    CustBuf.PostalCode Order.OrderNum.
  FOR EACH OrderLine OF Order NO-LOCK, Item OF OrderLine NO-LOCK:
    DISPLAY Item.ItemName Item.ItemLum LrderLine.Qty.
  END. /* FOR EACH OrderLine */
END. /* FOR EACH Order */
Notes 
*
The DEBUG( ) and INITIATE( ) methods provide separate means to invoke the Debugger, and do not depend on each other to start a debugging session. The DEBUG( ) method initializes and gives control to the Debugger whether or not the INITIATE( ) method has been executed.
*
*
Note:
*
*
*
When you set or cancel a breakpoint, you must distinguish between a line number value less than 1 and a value of 1 or greater. Any value for line-number less than 1 (for example, 0 or -1) specifies the first executable line of the main procedure in the file specified by procedure. However, a positive value for line-number specifies the first executable line on or after line-number in the file specified by procedure. For example, suppose procedure specifies a file like this:
 
1      DEFINE VARIABLE lStart AS LOGICAL NO-UNDO INITIAL TRUE.
2      PROCEDURE ShowStart:
3        IF lStart THEN MESSAGE "Procedure is starting ...".
4      END.
5      
6      MESSAGE "Hello World!".
7      RUN ShowStart.
8      lStart = FALSE.
         . . .
If you specify a breakpoint at line 0, -1, or any negative value, the breakpoint actually occurs at line 6, the first line that executes in the main procedure. If you specify a breakpoint at line 1 or 2, the breakpoint occurs at line 3, the first executable line in the file, which happens to be the first executable line of an internal procedure.
This distinction also affects procedures containing the Trigger phrase used to define triggers in widget definitions. For example, suppose procedure specifies this file:
 
1      DEFINE BUTTON bOK LABEL "OK"
2        TRIGGERS:
3          ON CHOOSE
4            MESSAGE "OK Pressed!".
5        END TRIGGERS.
6      MESSAGE "Hello World!".
         . . .
Again, if you specify a breakpoint at line -1, the breakpoint occurs on line 6, but if you specify the breakpoint at line 1, it actually occurs at line 4, which is the first executable line of a trigger block.
Note:
For more information on the Debugger, its features and functions, and its modes of execution, see OpenEdge Development: Debugging and Troubleshooting.
See also 
LOG-MANAGER system handle

Previous Next
© 2013 Progress Software Corporation and/or its subsidiaries or affiliates.