Changes in behavior introduced with Debug Tool for z/OS, Version 11.1
Beginning with Debug Tool for z/OS®, Version 11.1, Debug Tool changed how it processed nested blocks in C and C++ programs, thereby improving performance.
The z/OS XL C/C++ compiler defines a block statement (or block) as all definitions, declarations, and statements enclosed with a single set of braces: {}. You can nest blocks and the compiler assigns names to these blocks using the following pattern: %BLOCKn, where n is a sequential number.
To describe the difference in behavior, review the following example:
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#define NUM_INVOKE 5
main()
{ /* block 1 start */
int elm1 = 5, qvar1, qvar2, i;
qvar1 = 1;
qvar2 = 9;
for(i=0; i<NUM_INVOKE; ++i)
{ /* block 2 start */
qvar1 = qvar1 + 1;
qvar2 = qvar2 + 1;
} /* block 2 end */
qvar1 = qvar1 + 1;
qvar2 = qvar2 + 1;
if(elm1 = 5)
{ /* block 3 start */
qvar1 = qvar1 + 5;
qvar1 = qvar1 + 5;
} /* block 3 end */
else
{ /* block 4 start */
qvar1 = qvar1 - 5;
qvar2 = qvar2 - 5;
} /* block 4 end */
qvar1 = qvar1 - 1;
qvar2 = qvar2 - 1;
} /* block 1 end */
- Previous behavior
- After you enter the
AT ENTRY
,AT EXIT
,AT GLOBAL
, orAT PATH
command, z/OS Debugger would stop at the start, end, or both (depending on which command you entered) of all the blocks. - New behavior
- After you enter the
AT ENTRY
,AT EXIT
,AT GLOBAL
, orAT PATH
command, z/OS Debugger stops only at the start, end, or both (depending on which command you entered) of block 1.
Refer to the following topics for more information related to the material discussed in this topic.
- Related references
- Description of block statements in z/OS XL C/C++ Language Reference
- AT ENTRY command
- AT EXIT command
- AT GLOBAL command
- AT PATH command