|
Trace Execution
The following GPP system variables are used to invoke execution tracing:
TRACE_EXECUTE: Turn tracing on (when TRUE_) and off (when FALSE_).
Once TRACE_EXECUTE is set to TRUE_, GPP starts echoing a detailed log of the program execution to a log file named gpp2trace.txt (in the output folder). The same trace information is also displayed on the GPP2 message window, but only in single-step mode (see below).
The execution tracing log file details every statement being executed, including the GPP program line number, and then shows the result of the execution.
Examples:
Executing: 0064 X = (X_CURPOS + 20.0)
Result: X = 35.333333 // shows internal value
Executing: 0065 IF(VAR_SET(Arr[2]))
Condition: TRUE value
Executing: 0066 OUTPUT X CONTROL(10) "abc"
Output: "35.333" // the formatted value
Output: Char(10) // new-line character
Output: "abc"
Executing: 0067 GPP_CALLLPROC myproc (1, "abc")
Parameters myproc.step = 1, myproc.msg = "abc"
Notes:
-
The executed statements are not shown exactly as they were written in the original EXF file. What is shown is the compiled representation of these statements. In most cases, the printout will be self-explanatory. Note that expressions will be shown with parentheses, exactly describing the structure of complex mathematical expressions.
-
In IF_SET statements that use the traditional GPP "short form" to test if a variable is "on" (For example, IF_SET (X_CURPOS), the trace printout will show the implicit VAR_SET function used by GPP: IF (VAR_SET(X_CURPOS))
-
In assignment statements, the internal value of the assigned variables is shown, with 6 decimal digits, regardless of their format. The formatted form is clearly shown in OUTPUT statements of the variables.
-
When an assigned variable has identical variables, all of them will be shown in the result section. For instance:
Executing: 0064 X = (X_CURPOS + 20.0)
Result: X = Y = 35.333333 // X and Y are identical
-
Control characters (like \J) in Output statements are shown as CONTROL(nn), where nn is the ASCII value of the character. \A has ASCII value of 1, \J is 10, and \Z is 26. The resulting output is shown as Char(nn).
-
The execution of each block, including the new-line block, is titled.
-
When a procedure with parameters is called, the trace shows the values assigned to its parameters as follows: suppose a procedure myproc has a parameter step of type numeric. The trace will show myproc.step = 1.
|