SYMTAB SYMBOL TABLE EXTRACTOR: This program will extract global symbols from either an .OBJ, .STB, or .EXE (you MUST specify the /EXECUTABLE qualifier) file and generate an output definition file of the symbols. Symbols may be selected by using standard VMS wildcarding using the /FACILITY qualifier. The output file type is specified by the /LANGUAGE qualifier. This program was originally written for use with SDA, but there are now other "languages" supported. Use /LANGUAGE=NULL /OUTPUT=TT: to examine .STB and .EXE files on the terminal. The languages currently supported are: DCL - Global symbols can be used by DCL procedures LINKER - Used to create UNIVERSAL=xxx for input to the linker NULL - Outputs the symbol name and value SDA - Used to define image symbols for use within SDA This is enormously use when debugging software using SDA. If all routine names follow a standard convention, you extract all of the routine symbols, which can be used to define all of the routines for SDA. Then you can reference routines by name rather than by computing the address each time. Also, SHOW STACK will identify any routines on the stack by name, rather than by driver plus some offset. SDL - Used to define image symbols for use by SDL to create definitions for any SDL supported language To run this program, you may either place it in the system directory (SYS$SYSTEM) and make the .CLD definition part of your system DCLTABLES (SET COMMAND/TABLE=SYS$LIBRARY:DCLTABLES.EXE/OUTPUT=SYS$LIBRARY:DCLTABLE.EXE SYMTAB.CLD), or create a symbol pointing to the executable (SYMTAB :== $some_dir:SYMTAB.EXE) and still specify the qualifiers as if it were a native command. For example: SYMTAB/FACILITY=(SS$*,EXE$GL*)/LANGUAGE=NULL/OUTPUT=TT: will display all symbols starting with SS$, or EXE$GL*. When extracting symbols from images, specify the /EXECUTABLE qualifier, for example: SYMTAB/FAC=*BRK/LAN=NUL/OUT=TT: SYS$LOADABLE_IMAGES:SYSTEM_DEBUG.EXE/EXECUTABLE will display all symbols than end in BRK; in this case one. QUALIFIERS: /ALL Outputs all types of symbols found; used for debugging /EXECUTABLE Specifies that the input file is an image. /FACILITY VMS wildcard name of the symbols to extract; for a list, enclose the list in parentheses /LOG Doesn't do much at this time /LANGUAGE Specifies for which language to output the symbol definition Keywords are: DCL Creates DCL symbol definitions LINKER Use for specifying UNIVERSAL=symbol-name NULL Outputs symbol and type SDA Creates SDA commands for defining symbol; specify the /OFFSET qualifier when creating routine definitions SDL Creates SDL CONSTANT definitions; replace this if you have a specific language you want symbols for /OFFSET Used only for SDL output; specify the reference point all symbols are to be offset from, i.e. driver name. For example: SYMTAB/LANG=SDL/OFF=XXDRIVER/FAC=XX_* and all symbol definitions will be of the form : DEFINE XX_symbol = XX_symbol + XXDRIVER /OUTPUT Specifies the output file to write. If this qualifier is not specified, the output file will be the name of the input file with a .SYM file type In order to process executable images, an UNDOCUMENTED RMS function is used. This is because an image file is somewhat of a hybrid; it contains fixed length blocks (image stuff - ISDs, etc.), followed by variable length records containing the global symbol table, the debug symbol table, and the debug module table. Therefore, the image file is opened as a fixed block file in order to read the header which points to the variable length records at the end of the file. RMS's pointers are then updated to point to the variable length portion, and no one is the wiser. The default input filetype is .STB; the output file will have type .SYM and with the same name as the input. This was hacked together in about a day and a half, apologies for the lack of complete commenting. Brian Catlin Closed Loop Control 7-DEC-1990