Execute hook support

Language Environment gives you the capability to establish an exit that gains control when a compiled execute hook (EX) is enabled and executed. The user-provided exit is identified by the HLL user exit (CEEBINT) that is invoked during initialization of the Language Environment environment. Language Environment owns the HLL user exit and provides support for the execute hook exit.

The compiled execute hook can be a single event hook or a multiple event hook. A multiple event hook represents the simultaneous of more than one execute hook event. The multiple event hook collapses multiple EX instructions into a single EX instruction, followed by a NOP instruction.

Language Environment initialization:
  • Establishes the address of the hook handler entry point
  • Sets the hook handler suffix
  • Sets the hooks (CAA+X'01A8' thru CAA+X'01F0' for a length of X'48') to X'0700',S(CEECAAUDHOOK)
  • Sets the hook handler prefix

Invoking the event handler:

  • Single event hook:

    If the debugger has been initialized when a single event hook is enabled and executed, the debugger event handler is invoked with the following interface:

    1. Event code 133
    2. A DSA that was in control when the hook was executed
    3. The offset of the hooks within the hook set that was executed (a multiple of 4 ranging from 0 to 15 inclusive)
    4. DSA format
    5. A buffer containing general purpose registers
    6. Return address to the routine that was interrupted
    7. Entry point to the routine that was interrupted
  • Multiple event hook:

    If the debugger has been initialized when a multiple event hook is enabled and executed and the hook for at least one of the events is active, the debugger event handler is invoked with the following interface:

    1. Event code 189
    2. A DSA that was in control when the hook was executed
    3. The offset of a multiple event hook is a specific number determined by the events
    4. DSA format.
    5. A buffer containing general purpose registers
    6. Return address to the routine that was interrupted
    7. Entry point to the routine that was interrupted
    8. Event mask

In addition, R12 points to the CAA.

To enable a particular execute hook, set the first 2 bytes of the hook to X'45C0'. To disable a particular execute hook, set the first 2 bytes of the hook to X'0700'. No other values should be used for these first 2 bytes.