/*********************************************************** * symbol-related definitions for PL/I symbolic debugger * ***********************************************************/ dcl symfile file input sequential /**PL/I wont let us: static external*/ env( device(sy), recsize(128) ); /* 'virtual address in symbol table' means the address in the compiler's symbol table when it was in memory during the compile. read_symbol combines the virtual address with symfile_offset and symfile_module_base to calculate the file address of the corresponding point in the symbol table image in the symfile. symfile variables for the currently open symfile are in the current_module structure defined in brksymdef. structure of symbol table header is defined along with SET MODULE code. */ dcl 1 symdef external static, /*put in structure so names not constrained by 6 chars*/ 2 dot_valid fixed bin(1) initial(0/*false*/), /*true if have current variable in main_symp->symbol*/ 2 current_structure fixed bin(15), /*virtual address in symbol table - for examine successor*/ /* pointers to symbol structures, which are allocated by debinit: */ ( 2 main_symp, /*for examine/deposit*/ 2 subscript_symp, /*used for variable as a subscript processing (in variable)*/ 2 basing_symp, /*used for implicit basing symbol processing (in address_calc)*/ 2 scratch_symp /*used by address_calc, pathfind, set module, examine successor, etc*/ ) pointer static, 2 symbolheadersize fixed bin(15) initial(32); /*size of namebuffer plus namelength in symbol.buffer*/ dcl 1 symbol based(main_symp), /* used by pathbegin/pathnext/pathfind for processing block and structure references: */ 2 pathtype fixed bin(15), /*symbol_path or block_path*/ 2 pathlast fixed bin(15), /*how many names we have in following array*/ 2 pathnames (10), /*store member names for right to left match of un-fully-qualified references*/ 3 cmdpos fixed bin(15), /*position in commandline of beginning of name*/ 3 namlen fixed bin(15), /*length of name*/ /* filled in by block: */ 2 module_fileaddr fixed bin(23), /*file address of module hash record*/ 2 specified_block_code fixed bin(7), /*identifies local procedure*/ /* filled in by variable: */ 2 explicit_basing_pointer fixed bin(1), /*whether user specified basing pointer*/ 2 basing_address fixed bin(15), /*contents of basing pointer*/ 2 subscripts fixed bin(15), /*number of subscripts user specified, stored in following array*/ 2 subscript (0:8), /*0 keeps subscriptrange errors away if examine successor stumbles into array*/ 3 value fixed bin(15), /*result of evaluating subscript expression*/ 3 errp fixed bin(15), /*location in commandline of specified subscript, for pointing out errors*/ /*note: the max number of subscripts (8) is referred to non-symbolicly in the code*/ 2 symaddr fixed bin(15), /*virtual address in symbol table of record in following buffer*/ 2 buffer, /*remainder of structure is overwritten on read*/ /* actual PL/I symbol table entry, from symbol file: */ 3 namebuffer char(31), /*name, right justified*/ 3 namelength fixed bin(7), 3 nextsym fixed bin(15), /*virtual address of next symbol in symbol table*/ 3 attributes fixed bin(15), 3 offset fixed bin(15), /*for finding symbol's address in memory*/ 3 dimensions fixed bin(7), 3 blockxx fixed bin(7), /*block code of block symbol is defined in, and 2 flags*/ 3 ssize fixed bin(15), /*declared size (string), precision & scale factor (fixed bin)*/ /*note: only as many of following words are present as attribute bits indicate need for*/ 3 dope fixed bin(15), /*virtual address in symbol table of array prototype dope vector*/ 3 basingsym fixed bin(15), 3 parentsym fixed bin(15), /* filled in by read_symbol by unpacking above items: */ 3 name char(31) varying, 3 actual_block_code fixed bin(15), /*what procedure the symbol was defined in*/ 3 basing_symbol fixed bin(15), /*virtual address in symbol table of declared basing symbol, 0 if none*/ 3 parent_structure fixed bin(15), /*virtual address in symbol table of parent structure symbol, 0 if none*/ 3 attr_bits, /*must be contiguous & in this order - read_symbol decodes non-symbolically from attributes word:*/ 4 is_external fixed bin(1), /*bit 14*/ 4 is_label fixed bin(1), /*bit 13*/ 4 is_array fixed bin(1), /*bit 12*/ 4 is_arithmetic fixed bin(1), /*bit 11*/ 4 isnot_string fixed bin(1), /*bit 10*/ 4 is_varying fixed bin(1), /*bit 9*/ 4 is_binary_or_character fixed bin(1), /*bit 8, which meaning it has depends on is_arithmetic*/ 4 is_float_or_picture fixed bin(1), /*bit 7, which meaning it has depends on is_arithmetic*/ 3 is_pointer fixed bin(1), /*from special field in attributes word*/ 3 is_structure fixed bin(1), /*from special field in attributes word*/ 3 addressing fixed bin(15), /*addressing field in attributes word*/ /* all of the above except path stuff are inputs to address_calc */ /* following are outputs from address_calc: */ 3 descriptor fixed bin(15), /*address in user task of descriptor*/ 3 address fixed bin(15), /*address in user task of variable*/ 3 len fixed bin(15), /*number of bytes in variable*/ 3 type fixed bin(7), /*type code for examine/deposit (values defined in scandef)*/ 3 pad char(21); /*keep illegal record size errors away (file is written in 128-byte records)*/ dcl 1 symdf2 external, /*put in structure so names not constrained by 6 chars*/ 2 block_mask fixed bin(15) initial('77'B3), /*mask to get block code out of blockxx byte (low 6 bits)*/ 2 flag_in_structure fixed bin(15) initial('80'B4), /*bit 7 of blockxx byte (bit 15 of word)*/ /*bit indicating variable is in structure, parentsym word valid*/ 2 precision_mask fixed bin(15) initial('FF'B4), /*mask to get fixed bin precision out of ssize word (low byte)*/ 2 star_length fixed bin(15) initial('8000'B4), /*value of ssize word for char(*) declaration*/ ( /* attributes word constants: */ 2 attr_special initial('07700'B3), /*mask for bits 6-11*/ 2 attr_pointer initial('02200'B3), /*field value*/ 2 attr_structure initial('02600'B3), /*field value*/ 2 attr_addressing initial('37'B3), /*mask for bits 0-4 (addressing field)*/ 2 based_addressing initial('25'B3), /*field value*/ 2 static_addressing initial('27'B3), /*field value*/ 2 auto_addressing initial('24'B3), /*field value*/ 2 argument_addressing initial('34'B3) /*field value*/ ) fixed bin(15);