/* PL/I symbolic debugger routine to read a symbol table entry from the symbol file & decode it %include 'readsym.inc' for proper entry declaration note: it is caller's responsibility to ensure current_module is set to the proper module */ read_symbol: procedure(vsymaddr, symp); dcl vsymaddr fixed bin(15), /*virtual address in symbol table*/ symp pointer /*to a symbol structure*/; %include 'symdef.pli'; %include 'moddef.pli'; dcl iand entry(fixed bin(15), fixed bin(15)) returns(fixed bin(15)), posfile entry(file, fixed bin(23)); /*from workdef without symbol table overflow*/ dcl null_fileaddr fixed bin(23) external, (i, x) fixed bin(15), symp_decoded_bit(8) fixed bin(1) /*defined(symp->symbol.attr_bits)*/ based(pdecode); pdecode = addr(symp->symbol.attr_bits); /**************************************************************************************************************/ on endfile(symfile) /*do nothing*/; /*because we have to pad out the record, reading the last symbol may cause the read to go beyond end of file*/ symp->symbol.symaddr = vsymaddr; call posfile( symfile, symfile_module_base + (vsymaddr-symfile_offset) ); read file(symfile) into(symp->symbol.buffer); symp->symbol.name = substr(symp->symbol.namebuffer,symbolheadersize-iand(symp->symbol.namelength,31)); symp->symbol.actual_block_code = iand(symp->symbol.blockxx, block_mask); symp->symbol.addressing = iand(symp->symbol.attributes, attr_addressing); if symp->symbol.addressing = based_addressing then symp->symbol.basing_symbol = symp->symbol.basingsym; else symp->symbol.basing_symbol = 0; if iand(symp->symbol.blockxx, flag_in_structure) ^= 0 then symp->symbol.parent_structure = symp->symbol.parentsym; else symp->symbol.parent_structure = 0; /*decode attributes word into separate easily-tested variables:*/ x = symp->symbol.attributes; do i = 1 to 8; (nosize,nofixedoverflow): x = x + x; /*shift left one bit*/ symp_decoded_bit(i) = (x<0); end; if ^ symp->symbol.is_arithmetic & symp->symbol.isnot_string then x = iand(symp->symbol.attributes, attr_special); else x = 0; /*special field only valid if not arith and not string*/ symp->symbol.is_pointer = (x = attr_pointer); symp->symbol.is_structure = (x = attr_structure); end;