OWN - Execute user code during trace.

Description:

This type of trace permits you to gain control from the trace mechanism before each instruction is executed (or simulated). To engage an own code trace, you must supply a special subroutine to perform the desired tracing function(s). The entry point to the subroutine will be requested by the trace package, as follows:

ENTER ABS. ADDRESS OF OWN PROCEDURE:

At this time, you must enter the absolute address of the entry point to your subroutine procedure. When the next run command is issued, control will be passed to this entry point via a TSX1 before each instruction is executed, provided the instruction is in one of the specified tracing regions. This includes every step of an execute (XEC or XED) chain, but does not include repeated instructions; i.e., the subroutine will be entered before the repeat instruction itself is executed, but not before each execution of the repeated instruction(s). With EIS opcodes, your subroutine is called for each EIS descriptor.

Upon each entry into the subroutine, certain registers will be set by the trace mechanism, as follows:

Registers other than X1 need not be saved or restored by your subroutine. They will be properly restored by the trace mechanism when the subroutine returns.

Own code tracing can be a dangerous technique! For example, you must always be aware that your trace subroutine cannot use code which might also be used by the target program. The same, of course, goes for shared data areas. On the other hand, own code tracing can provide capabilities limited only by your imagination and ingenuity.

Copyright © 2000, Thinkage Ltd.