Labeled statement:
TRACE(LABEL: S;) = TRACE(S)
13. Null statement:
TRACE(;) = empty string
14. Compound statement:
TRACE({declaration-list, statement-list}) = TRACE(statement-list)
TRACE(S1; S2;) = TRACE(S1)
TRACE(S2)
The instrumentation tool examines each statement in the program, constructs
its trace as previously defined, assigns an identification number
called TN (trace number) to the trace, and stores the trace with its TN
103
Path-Oriented Program Analysis
in a file. The tool then constructs INST(S), which stands for ???the instrumented
version of statement S,??? and writes it into a file created for storing
the instrumented version of the program. Production of the trace is done
by the program execution monitor pem(). A function call pem(TN(S))
causes the trace of S numbered TN(S) to be fetched from the file and
appended to the trace being constructed. The definition of INST(S) is as
subsequently given:
1. Expression Statement: If E is an expression, then
INST(E;)=pem (TN(E));
E;
e.g., if 35 is the trace number associated with statement
cout << ???This is a test??? << endl;
then
INST(cout << ???This is a test??? << endl;) = pem (35);
cout << ???This is a test???
<< endl;
2. Condition Statement:
INST(if (P) S) = if (P) { pem (TN(P));
INST(S)
}else
pem (TN(!(P)));
INST(if (P) S1 else S2) = if(P) { pem(TN(P));
INST(S1)
}else { pem (TN(!(P)));
INST(S2)
}
104
Automatic Generation of Symbolic Traces
Note that the ???if??? statement may be nested, i.
Pages:
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113