Blocks and block identifiers for C
It is often necessary to set breakpoints on entry into or exit
from a given block or to reference variables that are not immediately
visible from the current block. z/OS® Debugger can do this, provided that
all blocks are named. It uses the following naming convention:
- The outermost block of a function has the same name as the function.
- For C programs compiled with the ISD compiler option, blocks enclosed
in this outermost block are sequentially named:
%BLOCK2
,%BLOCK3
,%BLOCK4
, and so on in order of their appearance in the function. - For C programs compiled with the DWARF compiler option, blocks
are named in a non-sequential manner. To determine the names
of the blocks, enter the
DESCRIBE CU;
command.
When these block names are used in the z/OS Debugger commands, you might
need to distinguish between nested blocks in different functions within
the same source file. This can be done by naming the blocks in one
of two ways:
- Short form
function_name:>%BLOCKzzz
- Long form
function_name:>%BLOCKxxx :>%BLOCKyyy:
… :>%BLOCKzzz
%BLOCKzzz
is contained in %BLOCKyyy
,
which is contained in %BLOCKxxx
. The
short form is always allowed; it is never necessary to specify the
long form.
The currently active block name can be retrieved from the z/OS Debugger variable
%BLOCK
.
You can display the names of blocks by entering:
DESCRIBE CU;