gtpi1m5n | System Installation Support Reference |
The user symbol override table user exit, USOT, allows you to define global symbols that override symbol definitions in the local symbol table or the common symbol table. For example, you can define symbol D0 in the symbol override table as a pointer to the storage block on data level 0 to override the definition in data macro (DSECT) CPSEQ, which has a value of 0.
The following search order is used in the symbol lookup process:
Input
A user-defined symbol override table. See Programming Considerations for more information.
const TPF_UDGS user_usot[] = { {"D0", usot_loc_d0, UGST_LOC_PTR}, {"D1", usot_loc_d1, UGST_LOC_INDIRECT}, {"NULL, NULL, UGST_LOC_PTR} },
In the previous example, you must provide the ugst_loc_d0 and ugst_loc_d1 functions to resolve symbols D0 and D1. The resolving function is defined as follows:
UDGS_RC func(char *parm, UDGS_RESULT *result);
See the usot.cpp, ugst.cpp, and cgstab.cpp files for examples of the resolving function.
void *D0; /* the variable name must match the symbol name */ void *D1;
Array declarations must have at least one item, for example:
void* DECB[1]
You must compile the usotdc.c program with the NORENT, NODLL, and TEST(SYM,NOBLOCK,NOLINE,NOPATH,NOHOOK) options.
If the global symbol resolves to UDGS_PTR_LIST, the resolving function is responsible for allocating storage to hold the pointer list. Both the TPF C Debugger for VisualAge Client and the TPF Assembler Debugger for VisualAge Client will call the resolving function with result->ptrList set to NULL the first time the resolving function is called. The resolving function is responsible for allocating storage to hold the pointer list and to return the pointer list in result->ptrList. Both the TPF C Debugger for VisualAge Client and the TPF Assembler Debugger for VisualAge Client will pass ptrList to the resolving function on all subsequent calls.
The resolving function must be aware that when a USOT symbol is entered from the TPF Assembler Debugger for VisualAge Client, the debugger ECB (not the application ECB) is in control. The resolving function must include the correct logic to retrieve the information from the application ECB. See the usot.cpp, ugst.cpp, and cgstab.cpp files for examples of the resolving function.
If the return type for the global symbol is UGST_LOC_PTRLIST, the symbol must be declared as an array of one element in the xxxxdc.c file so that TPF C Debugger for VisualAge Client can recognize it as an array of pointers.
Depending on the C structure that is declared for the global symbol, TPF C Debugger for VisualAge Client will use various amounts of ECB heap areas to process the global symbol. Declare the global symbol as void * and use XMP map to map to the data that will use the least amount of ECB heap area.
Return Values