Blocks and block identifiers in C and C++ programs
In the program above, the function
sort has the following
three blocks:
| If program is compiled with the ISD compiler option | If program is compiled with the DWARF compiler option |
|---|---|
sort |
sort |
%BLOCK2 |
%BLOCK8 |
%BLOCK3 |
%BLOCK13 |
The following examples set a breakpoint on entry to the second
block of
sort:
- If program is compiled with the ISD compiler option:
at entry sort:>%BLOCK2;. - If program is compiled with the DWARF compiler option:
at entry sort:>%BLOCK8;.
The following example sets a breakpoint on exit of the first block
of
main and lists the entries of the sorted table.
at exit main {
for (i = 0; i < length; i++)
printf("table entry %d is %d\n", i, table[i]);
}The following examples list the variable
temp in the
third block of sort. This is possible because temp has
the static storage class.
- If program is compiled with the ISD compiler option:
LIST sort:>%BLOCK3:temp;. - If program is compiled with the DWARF compiler option:
LIST sort:>%BLOCK13:temp;.