Program-Stop Handler Exit Program


  Required Parameter Group:


  QSYSINC Member Name: ETEPGMST

  Threadsafe: No

The Program-Stop Handler exit program is a user-written program that handles program-stop conditions.

This program must be identified to the Source Debugger support with the Start Source Debug (QteStartSourceDebug) API.

Breakpoint- and step-program stop conditions are reported using stop reasons 2, 3, and 4. The location at which the program-stop condition occurred is specified in the receiver variable parameter and is in terms of the statement view. The user-supplied program may use the Map View Position (QteMapViewPosition) API to determine the location to which this program maps any other registered view.

Watch-program stop conditions are reported using stop reasons 5 and 6. For watch-program stop conditions, the program stopped might not have debug data. In this case, the machine interface (MI) number is reported for OPM programs and the statement number is reported for ILE programs and Java™ class files. If the program can be debugged, the line number in the statement view is reported for OPM programs, ILE programs, and Java class files. Other information is also included in the receiver variable to identify the program that caused the watch condition to be satisfied.

Unmonitored-exception-program stop conditions are represented through stop reason 1. Unmonitored exceptions are reported through this exit program only when the program and module identified have been created with debug data. Without debugging data, the message that is the cause of the unmonitored exception is issued, and the Program-Stop Handler exit program is not called.

When a job being debugged by a servicing job is stopped by the QteStopDebuggedJob API, reason code 7 is reported. When this reason code is reported, none of the other input parameters are used and can be ignored.

Debugging of threaded jobs is enabled by the thread ID field that is contained in the parameters passed to the stop handler. Threads debugging is supported if a service job is used to debug a job that was spawned by native threads support. For nonthreaded applications, the thread ID passed will always be that of the initial job thread.


Authorities and Locks

None.


Required Parameter Group

Qualified program name
INPUT; CHAR(20) or CHAR(*)

The format of this parameter is dependent on the program type parameter. If the program type is *PGM or *SRVPGM, the format of this parameter is as follows:

The name of the program that is stopped as a result of a breakpoint, program step, or unmonitored exception. This parameter may also be the name of the program that is stopped because a watch condition has been satisfied.

The first 10 characters contain the name of the program. The second 10 characters contain the name of the library where the program is located. Each name is left-justified.

If the program type is *CLASS, the format of this parameter is as follows:

The null-terminated class file name of the JAVA class.

Program type
INPUT; CHAR(10)

The object type of the program that is stopped. The possible values are:


Module name
INPUT; CHAR(10)

The name of the module (left-justified) that is stopped. The value of this field is blank for OPM programs and JAVA class files.

Stop reason
INPUT; CHAR(10)

The reason the program was called. Each character of this parameter has a specific meaning. The characters and their meanings are:


Receiver variable
INPUT; CHAR(*)

Stop Reasons 1, 2, 3, 4:

If only stop reason 1, 2, 3, or 4 is present, the following receiver variable format is passed:

A list of locations within the statement view where the program stop condition occurred. This list contains the number of entries where each number is defined as follows:

Stop Reasons 5, 6:

Whenever stop reason 5 or 6 is present (other stop reasons can be present also), the following receiver variable format is passed:

Information about the watch stop condition, including the program stopped and the program that caused the watch condition to be satisfied. See Format of Watch-Program Stop Reason for Receiver Variable.

Stop Reason 7:

For stop reason 7, the receiver variable parameter is not used and can be ignored.

Number of entries
INPUT; BINARY(4)

The number of positions stored in the receiver variable parameter. In some cases, it is not known exactly where a program is stopped; therefore, multiple positions are given. Each entry specifies one position in the statement view. This number is not less than one nor greater than three. At least one stopped position will be identified; if stopped at more than one position, no more than the first three positions are made available.

This parameter is valid when stop reason 1, 2, 3, or 4 is the only reason present (stop reason 5 or 6 cannot be present). If stop reason 5 or 6 is present, the receiver variable contains the equivalent number of stopped locations parameter.

Message data
INPUT; CHAR(*)

Information about the message. The information in this parameter is valid only when the stop reason specified is an unmonitored exception. For a detailed description of the format, see Format of Message Data.


Format of Watch-Program Stop Reason for Receiver Variable

The following table shows the information supplied in the receiver variable parameter when a stop reason of 5 or 6 is present. For more information on the fields, see Field Descriptions.


Watch Receiver Variable Header



Watch Stopped Program Information

The following table shows the stopped program information that is supplied in the receiver variable parameter. This data structure is accessible by adding the offset to stopped program information field in the receiver variable header to the address of the receiver variable.



Watch Interrupt Information

The following table shows the watch-interrupt information that is supplied in the receiver variable parameter. This data structure is accessible by adding the offset to watch interrupt information field in the receiver variable header to the address of the receiver variable.



Field Descriptions

Interrupt class file name. The Java class file name of the Java class containing the locations that caused the watch condition to be satisfied. For OPM and ILE programs, the Java class file name is not returned.

Interrupt locations. A list of locations, of the type described by the interrupt locations flag, that caused the watch condition to be satisfied.

Interrupt locations flag. The type of the locations in the interrupt locations field. All locations are of the same type.

Interrupt module name. The name of the module (left-justified) in the program that caused the watch condition to be satisfied. The value of this field is blank for OPM programs and JAVA class files.

Interrupt procedure name. The procedure name of the procedure that contains the program locations that caused the watch condition to be satisfied. For OPM programs the procedure name is not returned.

Interrupt program type. The object type of the program that caused the watch condition to be satisfied. The possible values follow:

Length of interrupt class file name. The length of the interrupt class file name. This field is zero if there is no interrupt class file name available (for example, OPM and ILE programs).

Length of interrupt procedure name. The length of the interrupt procedure name. This field is zero if there is no interrupt procedure name available (for example, OPM programs).

Length of stopped procedure name. The length of the stopped procedure name. This field is zero if there is no stopped procedure name available (for example, OPM programs).

Number of interrupt locations. The number of locations in the program that caused the watch condition to be satisfied. At most, three locations are returned.

Number of stopped locations. The number of stopped program locations. At most, three stop locations are returned.

Offset to interrupt class file name. The offset from the start of the receiver variable to the name of the Java class file containing the location that caused the watch condition to be satisfied. The field is zero if there is no interrupt class file name available (for example, OPM and ILE programs).

Offset to interrupt locations. The offset from the start of the receiver variable to the list of locations in the program that caused the watch condition to be satisfied.

Offset to interrupt procedure name. The offset from the start of the receiver variable to the name of the procedure that contains the program location that caused the watch condition to be satisfied. This field is zero if there is no interrupt procedure name available (for example, OPM programs).

Offset to stopped locations. The offset from the start of the receiver variable to the stopped program location entries.

Offset to stopped procedure name. The offset from the start of the receiver variable to the name of the procedure that contains the stopped program location. This field is zero if there is no stopped procedure name available (for example, OPM programs).

Offset to stopped program information. The offset from the start of the receiver variable to the stop information for the program that is stopped as a result of the watch condition being satisfied.

Offset to watch interrupt information. The offset from the start of the receiver variable to the watch interrupt information. This data structure describes the program that caused the interruption.

Qualified interrupt job name. The name of the job that caused the watch condition to be satisfied. The first 10 characters contain the job name. The second 10 characters contain the user profile name. The next 6 characters contain the job number. Each name is left-justified.

Note: This field is the same as the name of the job being debugged. Watch program interruptions in other jobs are ignored.

Qualified interrupt program name. The name of the program that caused the watch condition to be satisfied. The first 10 characters contain the name of the program. The second 10 characters contain the name of the library where the program is located. Each name is left-justified. The value of this field is blank for Java class files.

Reserved. An ignored field.

Stopped locations. A list of locations, of the type described by the stop location flag, where the program stop condition occurred.

Stopped locations flag. The type of the locations in the stop locations field. All stop locations are of the same type.

Stopped procedure name. The name of the procedure that contains the stopped locations. For OPM programs the procedure name is not returned.

Thread ID. This is an 8-byte thread identification that is assigned by the system. It identifies the thread associated with the stopped or interrupt locations fields.

Watch number. The watch number identifier of the watch condition being satisfied. This is the same number that is returned by the Submit Debug Command API when the watch condition was set.


Format of Message Data

The following table shows the information supplied in the message data parameter. For more information on the fields, see Field Descriptions.



Field Descriptions

Length of message data. The length of the data available in the message data parameter, in bytes. This field contains the length of the available message data for the predefined message indicated in the message ID field.

Message data. The values for substitution variables in the predefined message specified in the message ID field and located in the message file field.

Message file. The name of the message file that contains the message identified in the message ID field.

The first 10 characters contain the message file name. The second 10 characters contain the name of the library where the file can be located. Both entries are left-justified.

Message ID. The identifying code of the message.

Reserved. An ignored field.


Exit program introduced: V2R3

[ Back to top | Debugger APIs | APIs by category ]