The BREAK command pauses execution of the code and initiates Direct Mode.
The format of the BREAK command is:
B[REAK][:tvexpr] [expr[:tvexpr][,...]]
The optional truth-valued expression immediately following the command is a command postconditional that controls whether or not GT.M executes the command.
The optional expression contains a fragment of GT.M code to XECUTE before the process enters Direct Mode.
The BREAK command without an argument causes a pause in execution of the routine code and immediately initiates Direct Mode. In this case, at least two (2) spaces must follow the BREAK to separate it from the next command on the line.
The optional truth-valued expression immediately following the expression is the argument postconditional that controls whether GT.M XECUTEs the argument. If present and true, the process executes the code before entering Direct Mode. If present and false, the process does not execute the code before entering Direct Mode.
An indirection operator and an expression atom evaluating to a list of one or more BREAK arguments form a legal argument for a BREAK.
Issuing a BREAK command inside a transaction destroys the Isolation of that transaction. Beacuse of the way that GT.M implements transaction processing, a BREAK within a transaction may suffer an indefinite number of restarts ("live lock").
Generally, programs in production must not include BREAK commands. Therefore, GT.M provides the ZBREAK and ZSTEP commands, which insert temporary breakpoints in the image rather than the source code. BREAKs inserted with ZBREAK only exist until the image terminates or until explicitly removed by another ZBREAK command. ZSTEP also inserts temporary BREAKs in the image that only exist for the execution of the ZSTEP command. In the GT.M debugging environment, ZBREAKs and ZSTEPs that insert BREAKs provide a more flexible and less error-prone means of setting breakpoints than coding BREAKs directly into a routine. For more information on ZBREAK and ZSTEP, refer to the sections that describe those commands.
To resume execution of the interrupted program, use the ZCONTINUE command.
GT.M displays messages identifying the source of a BREAK as:
The body of a program
A ZBREAK action
A device EXCEPTION
A ZSTEP action
The VIEW "BREAKMSG" mask selectively enables or disables these messages. See the section on "VIEW" for an explanation of the mask. By default, a process executing a GT.M image displays all BREAK messages.
LINKing a GT.M image with a modified GTM$DEFAULTS can alter the default for that image. For more information on GTM$DEFAULTS see the "Program Development Cycle" chapter in this manual.
When a process encounters a BREAK, it displays a prompt indicating readiness to process commands in Direct Mode. By default, Direct Mode displays the GTM> prompt. SETting the $ZPROMPT intrinsic special variable alters the prompt.