gtpi1m5k | System Installation Support Reference |
The user global symbol table user exit, UGST, allows you to define global symbols that do not exist in a program for resolution. These definitions can be used as a valid expression request in both the TPF Assembler Debugger for VisualAge Client and the TPF C Debugger for VisualAge Client.
Input
A user-defined global symbol table. See Programming Considerations for more information.
const TPF_UDGS user_ugst[] = { {"PAT", ugst_loc_pat, UGST_LOC_PTR} {NULL, NULL UGST_LOC_PTR} };
You must also provide the function to resolve any user-defined global symbols defined in the user-defined global symbol table. The resolving function is defined as follows:
UDGS_RC func(char *parm, UDGS_RESULT *result);
The following example resolves UGST symbol PAT:
UDGS_RC ugst_loc_pat (NULL, UDGS_RESULT * result) { result->ptr = cinfc_fast (CINFC_CMMPAT); return UDGS_RC_OK; }
struct pat *PAT; /* the variable name must match the symbol name */
Array declarations must have at least one item, for example:
void* DECB[1]
You must compile the ugstdc.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 UGST 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