AT CHANGE command (remote debug mode)
Gives z/OS® Debugger control when the program changes the specified variable value.
'reference'or"reference"- A valid z/OS Debugger reference in the current programming language.
Usage notes
- When you enter an
AT CHANGEcommand, the breakpoint is set relative to the location the program is stopped, which might not be the program displayed in the source view. For example, your program is stopped at program SUB1, which was called by program MAIN1, and the source view displays the source for program SUB1. Then, you click on MAIN1 in the Debug view so that the source view displays the source for MAIN1. If you enter the commandAT CHANGE "Var1", a breakpoint is set to monitor any changes to a variable called "Var1" in SUB1, not a variable called "Var1" in MAIN1. - If an
AT CHANGEbreakpoint is set on a file record of a BLOCKED QSAM file that is open OUTPUT or EXTEND, the breakpoint might not occur as expected when the WRITE statement is used. The breakpoint behavior in this case is not predictable because the file record is mapped onto the data management buffer.To get predictable
AT CHANGEbehavior in this case, set up the file to use a SAME RECORD AREA clause. - Data is watched only in storage; hence a value that is being kept
in a register because of compiler optimization cannot be watched.
In addition, the z/OS Debugger variables
%GPRn,%Rn,%FPRn,%LPRn,%EPRn, and any assembler or disassembly symbols representing registers cannot be watched. - Only entire bytes are watched; bits or bit strings within a byte cannot be singled out.
- Because
AT CHANGEbreakpoints are identified by storage address and length, it is not possible to have twoAT CHANGEbreakpoints for the same area (address and length) of storage. That is, anAT CHANGEcommand replaces a previousAT CHANGEcommand if the storage address and length are the same. However, any other overlap is ignored and the breakpoints are considered to be for two separate variables. For example, if the storage address is the same, but the length is different, theAT CHANGEcommand does not replace the previousAT CHANGE. - When more than one
AT CHANGEbreakpoint is triggered at a time,AT CHANGEbreakpoints are triggered in the order that they were entered. However, if the triggering of one breakpoint causes a variable watched by a different breakpoint to change, the ordering of the triggers will not necessarily be according to when they were originally entered. For example,AT CHANGE y LIST y; AT CHANGE x y = 4; GO;If the next statement to be executed in your program causes the value of
xto change, theCHANGE xbreakpoint is triggered when z/OS Debugger gains control. Processing ofCHANGE xcauses the value ofyto change. If you typeGO;after being informed thatCHANGE xwas triggered, z/OS Debugger triggers theCHANGE ybreakpoint (before returning control to your program).In this case, the
CHANGE ybreakpoint was entered first, but theCHANGE xbreakpoint was triggered first (because it caused theCHANGE ybreakpoint to be triggered). - The referenced variable must exist when the
AT CHANGEbreakpoint is defined. - An
AT CHANGEbreakpoint gets removed automatically when the specified variable is no longer defined.AT CHANGEs for C static variables are removed when the module defining the variable is removed from storage. For C storage that is allocated usingmalloc()orcalloc(), this occurs when the dynamic storage is freed usingfree(). - Changes are not detected immediately, but only at the completion of any command that has the potential of changing storage or variable values.
- C and C++
AT CHANGEbreakpoint requirements- The variable must be an lvalue or an array.
- The variable must be declared in an active block if the variable
is a parameter or has a storage class of
auto. - A
CHANGEbreakpoint defined for a static variable is automatically removed when the file in which the variable was declared is no longer active. ACHANGEbreakpoint defined for an external variable is automatically removed when the module where the variable was declared is no longer active. - If reference is a pointer, z/OS Debugger stops when the contents of storage at the address given by that pointer changes.
- COBOL
AT CHANGEbreakpoint requirementsAT CHANGEusing a storage address should not reference a data item that follows a variable-size element or subgroup within a group. COBOL dynamically remaps the group when a variable-size element changes size.- Be careful when examining a variable whose allocated storage follows that of a variable-size element. COBOL dynamically remaps the storage for the element any time it changes size. This could alter the address of the variable you want to examine.
- You cannot set a
CHANGEbreakpoint for a COBOL file record before the file is opened. - The variable, when in the local storage section, must be declared in an active block.
- The qualification operator "
::" is not supported in Debug Console commands. Use the "OF" or "IN" qualification operator instead.
- PL/I
AT CHANGEbreakpoint requirementsCHANGEbreakpoint is removed for based or controlled variables when they areFREEd and for parameters andAUTOMATICvariables when the block in which they are declared is no longer active.CHANGEmonitors only structures with single scalar elements. Structures containing more than one scalar element are not supported.- The variable must be a valid reference for the current block.
- The breakpoint is automatically removed after the referenced variable ceases to exist.
- A
CHANGEbreakpoint monitors the storage allocated to the current generation of a controlled variable. If you subsequently allocate new generations, they are not monitored.
- When you free storage with the
STORAGE RELEASEmacro in an assembler or disassembly program, it is not possible to detect when the storage is freed. If you set anAT CHANGEbreakpoint on storage freed by aSTORAGE RELEASEmacro, unexpected results might occur, such as the triggering of the breakpoint at unexpected times. - For optimized COBOL programs, the specified variable cannot be a variable that was discarded due to compiler optimization.
- When you use a COBOL level-88 variable on an
AT CHANGEcommand, the current setting of the value is saved. z/OS Debugger stops at the breakpoint only if the setting of the COBOL level-88 variable changes from the saved value to a different value. For example, if the saved value was TRUE and the new value is FALSE, z/OS Debugger stops at the breakpoint. - To use a COBOL level-88 variable with the
AT CHANGEcommand, you (through a z/OS Debugger command) or the program must have previously set the variable to one of the values specified in the variable's declaration. If you do not do this, z/OS Debugger behavior becomes unpredictable. - If reference references 64-bit addressable storage, z/OS Debugger assumes that the storage location is 64-bit addressable storage. Otherwise, z/OS Debugger assumes that the storage location is 31-bit addressable storage.
Refer to the following topics for more information related to the material discussed in this topic.
