gmscTraceLogClass
The TraceLog Service Class
Section titled “The TraceLog Service Class”The service class TraceLog logs tracing messages intended to aid in the analysis and debugging of the translations produced by the tool. Its methods are controlled via various Select debugging flags.
The TraceCalls debugging flag attribute tells the expression processor within the compiler to issues detailed progress messages. These messages can be used to determine why particular types of code have been generated. The output produced is extensive as the following fragment shows.
The TraceChanges debugging flag attribute writes a log message each time the compiler or analyser changes the type or context flags of a component. The message has the following columns:
| Column | Description of content |
|---|---|
| subRoot | The root offset of the subprogram containing the code upon which the change is based |
| symRoot | The root offset of the component that is being changed |
| lineno | The approxinent line number of the source statement upon which the change is based |
| value | The new value being set |
| file | The root offset of the source file containg the code upon which the change is based |
| change | A code indicating the context in which the change was made |
The method TraceLog_LitmusTest
Section titled “The method TraceLog_LitmusTest”Prototype
void TraceLog_LitmusTest(int subRoot,int iCall)The TraceLog_LitmusTest method logs a message requested by the LitmusTests debugging flag. This flag attribute directs the analyser to perform various detailed tests on the compiled code as it is processed and transformed into its final form. The messages produced can be used to trace particular problems being introduced into the analysed code. Its parameters are as follows:
| Parameter | Description |
|---|---|
| subRoot | specifies the root offset of the component whose code is currently being analysed. |
| iCall | specifies a unique call number that can be used to identify the precise call to this method that is logging the message. |
The method TraceLog_GetObjectType
Section titled “The method TraceLog_GetObjectType”Prototype
int TraceLog_GetObjectType(int iCall,int root)The TraceLog_GetObjectType method traces calls to the Store_GetObjectType method and logs a message for any calls that have a potentially malformed root parameter. Its parameters are as follows:
| Parameter | Description |
|---|---|
| iCall | specifies a unique call number that can be used to identify the precise call to this method that is logging the message. The last used value of iCall was 982. |
| root | specifies the root offset of the component whose object type is wanted. |
The method returns the storage object type of the component if its root offset is well-formed else it returns zero.
The method TraceLog_TraceCall
Section titled “The method TraceLog_TraceCall”Prototype
void TraceLog_TraceCall(int iCall,int subCall,int* Parents,char* statement)The TraceLog_TraceCall method logs a message during compilation requested by the TraceCalls debugging flag. This flag attribute directs the compiler to trace the calls made during compilation. The messages produced can be used to trace particular problems being introduced by the compiler. Its parameters are as follows:
| Parameter | Description |
|---|---|
| iCall | specifies a unique call number that can be used to identify the precise call to this method that is logging the message. |
| subCall | specifies a support value associated with the call to facilitate debugging. |
| Parents | contains the number and root offsets of the components in whose scope the call occurs. |
| statement | contains the actual statement that is causing the call. |
The method TraceLog_SetTracing
Section titled “The method TraceLog_SetTracing”Prototype
void TraceLog_SetTracing(int on)The method TraceLog_SetTracing method turns the call tracing flag on or off. Its parameter is as follows:
| Parameter | Description of value |
|---|---|
| on | specifies whether the flag should be on or off. A value of zero turns it off; else it is turned on. |