AT EXIT command

Defines a breakpoint at the specified exit point in the specified block.

Read syntax diagramSkip visual syntax diagramATevery_clauseEXITblock_spec(,block_spec)*command;
*
Sets a breakpoint at every EXIT of any block.
command
A valid z/OS® Debugger command.
Usage notes
  • For VS COBOL II programs, z/OS Debugger supports only the AT EXIT * command.
  • An AT EXIT breakpoint can only be set for programs that are currently fetched or loaded. To set an exit breakpoint for a currently unknown compile unit, use the AT APPEARANCE command.
  • An EXIT breakpoint set for a compile unit that becomes nonactive (one that is not in the current enclave), is suspended until the compile unit becomes active. An EXIT breakpoint set for a compile unit that is deleted from storage is suspended until the compile unit is reloaded. A suspended breakpoint cannot be triggered until it is reactivated.
  • For a CICS® application on z/OS Debugger, this breakpoint is cleared at the end of the last process in the application. For a non-CICS application on z/OS Debugger, it is cleared at the end of a process.
  • EXIT breakpoints for blocks in a fetched or loaded program are removed when that program is released.
  • The AT EXIT command cannot be used while you replay recorded statements by using the PLAYBACK commands.
  • You cannot use the AT EXIT command when you are in a disassembly compile unit.
  • You cannot use the AT EXIT command when you are in a LangX COBOL compile unit.
  • For assembler only: AT EXIT gains control on exit from internal or external routines. An EXIT is defined to be one of the following opcodes:
    • BR
    • BALR, BASR, or BASSM when it is not followed by a valid instruction
  • You cannot use the AT EXIT command to stop at the exit of a nested block in a C or C++ program. A nested block is a group of statements delimited by { and }. The compiler assigns a name to these blocks using the following pattern: %BLOCKn, where n is a sequentially-assigned number.

Example

At exit of main, print a message and TRIGGER the SIGUSR1 condition. The current programming language setting is C.
AT EXIT main {
  puts("At exit of the program");
  TRIGGER SIGUSR1;
  GO;
}

Refer to the following topics for more information related to the material discussed in this topic.