Chapter Contents

Previous

Next
Debugger I/O Exit Routines

Introduction

You can provide exit routines to handle debugger line mode input or output. These exits enable you to use the debugger under circumstances where using its standard terminal input implementation, output implementation, or both is not appropriate or sufficient. These debugger I/O exits must be written in assembler language. Further, they cannot cause the C environment of either the debugger or the program being debugged to be reentered. If they do, the results are unpredictable. Therefore, exit routines must not invoke any C functions.

Note:    The interface to debugger exit routines might change in a future release of the SAS/C Compiler. If the interface does change, you might have to modify some or all of your exit routines. However, any future interface will support at least the functionality that is described in the following sections.  [cautionend]

Also note that I/O exit routines cannot be used in full-screen mode. You must switch to line mode by issuing a window off command before invoking an I/O exit routine.


Using Debugger Exit Routines

Debugger exit routines provide flexibility to the debugging environment. Output from the debugger can be modified, for example, to produce a different prompt for each OS/390 subtask that is being debugged, thus suffixing the standard prompt (which does not go through the output exit because it is produced by the PROMPT=string amparm). Input and output can be routed to a different virtual machine. An assembler subroutine can pass debugger commands from the program to the debugger via the exit routines, thus providing the functionality of embedding debugger commands in source code.


Invoking Debugger Exit Routines

Each debugger exit routine is a separate load module. The names are L$UDBIN and L$UDBOUT. Under CMS, place these modules in the L$CUSER LOADLIB that you create. Under OS/390, place these modules in SASC.LINKLIB. At debugger initialization time, the debugger looks for each of these load modules. If neither is present, then no further processing is done for that exit routine, and debugger execution proceeds without using that exit routine. Thus, each routine can be used independently. If you do use both routines, they can communicate as described in the following sections.

Each routine is invoked by using standard IBM linkage conventions. Any registers that are used by the routine should be saved (the standard save area that is addressed by register 13 can be used for this) and restored on exit, except as otherwise described below. On entry, register 1 addresses a parameter block. The first parameter in this block is always a call type flag. Other parameters can differ for different call types and these are described in more detail in Sample Debugger Exit Routines. The call type flag can have the values 4 (initialization), 0 (input or output call), or 8 (termination).

The debugger output exit routine can be called to handle attention interrupts that are detected by the debugger. The output exit provides a method for generating simulated attention interrupts. At initialization, the output exit routine can request that the debugger ignore all attention interrupts except those that are generated by the exit routine.

The output exit routine (L$UDBOUT) is invoked first. If you want the two exit routines to communicate, L$UDBOUT is responsible for setting up that communication.


Chapter Contents

Previous

Next

Top of Page

Copyright © 2001 by SAS Institute Inc., Cary, NC, USA. All rights reserved.