Inspect Manual

Using Inspect With Accelerated Programs on TNS/R
Systems
Inspect Manual429164-006
16-22
Annotated ICODE
Accelerating a program may cause fewer step operations to be required to step
execution through some looping constructs. Depending on compiler code
generation, the accelerator may branch execution to the middle of a statement,
where there is no memory-exact point. Since STEP operations always leave a
program at a memory-exact point, execution of the program will not be suspended
until the next memory-exact point is reached. Usually, this is the next statement.
Example
The following example illustrates that Inspect STEP behavior within loops may differ
between TNS programs and accelerated programs, as illustrated with using this
sample code written in C.
The following illustrates the result of issuing successive STEP commands. Each line
shows the line from the preceding source that execution has been advanced to.
Note, in the accelerated program, Inspect does not stop on statement 3 after the first
time through the loop. At the locations where it stops in both the TNS and TNS/R
code, both programs will be in the same state. For example, displaying the value of I
while at the second instance of statement 4, yields the same results for both programs.
Annotated ICODE
When debugging accelerated programs, TNS instruction code mnemonics listed by the
SOURCE ICODE and ICODE command and the low-level I command are annotated to
indicate which locations are register-exact points (@) and which are memory-exact
points (>).
Statement
Number func1()
* 1 {
int i,j,k;
2 k = 1;
3 for (i=0; i<2; i++) {
4 j = 50 * i;
5 k += 100 + j;
6 } /* end for */
7 printf ("i=%d, j=%d, k=%d\n", i, j, k);
8 }
Stepping a TNS program Stepping an Accelerated program
1 { 1 {
2 k = 1; 2 k = 1;
3 for (i=0; i<2; i++) { 3 for (i=0; i<2; i++) {
4 j = 50 * i; 4 j = 50 * i;
5 k += 100 + j; 5 k += 100 + j;
6 } /* end for */ 6 } /* end for */
3 for (i=0; i<2; i++) {
4 j = 50 * i; 4 j = 50 * i;
5 k += 100 + j; 5 k += 100 + j;
6 } /* end for */ 6 } /* end for */
3 for (i=0; i<2; i++) {
7 printf ("i=%d, j=%d, 7 printf ("i=%d, j=%d,
k=%d\n", i, j, k); k=%d\n", i, j, k);