COMPILATION LISTING OF SEGMENT db_get_sym Compiled by: Multics PL/I Compiler, Release 28d, of October 4, 1983 Compiled at: Honeywell LCPD Phoenix, System M Compiled on: 11/02/83 1312.1 mst Wed Options: optimize map 1 /* *********************************************************** 2* * * 3* * Copyright, (C) Honeywell Information Systems Inc., 1982 * 4* * * 5* *********************************************************** */ 6 7 /* ****************************************************** 8* * * 9* * * 10* * Copyright (c) 1972 by Massachusetts Institute of * 11* * Technology and Honeywell Information Systems, Inc. * 12* * * 13* * * 14* ****************************************************** */ 15 16 db_get_sym: proc (a_sntp); 17 18 19 /* This procedure is called to get a pointer to a symbol table block. 20** The pointer passed as an argument points to the segment name table 21** of the procedure whose symbol table block we are to find. 22** 23** Rewritten on Nov. 7, 1972 for the 6180 by Bill Silver. 24** Modified Nov. 1, 1983 by Melanie Weaver to remove call to stu_$get_runtime_block 25**/ 26 27 dcl a_sntp ptr; /* Pointer to the procedure's segment name table. */ 28 29 dcl hdr_ptr ptr, /* Pointer to the header of the symbol table. */ 30 31 bp ptr, 32 33 work_ptr ptr; /* Temporary pointer. */ 34 35 36 dcl offset fixed bin(18), /* Offset of procedure within its segment. */ 37 38 len fixed bin, /* Length of the entry name. */ 39 40 root bit(18); /* Offset of root. */ 41 42 43 44 45 dcl stu_$find_containing_block 46 ext entry (ptr, fixed bin(18)) returns (ptr), 47 stu_$find_header ext entry (ptr, char (32) aligned, fixed bin) returns (ptr), 48 stu_$find_block ext entry(ptr,char(*)) returns (ptr); 49 1 1 /* BEGIN INCLUDE FILE . . . db_ext_stat_.incl.pl1 1 2* * 1 3* * This include file is used to reference the common data that is passed from the 1 4* * main debug procedure "debug" to other debug procedures. This data is in db_ext_stat_.alm 1 5* * 1 6* * modified 7/75 by S.E. Barr for the break instructions 1 7**/ 1 8 1 9 dcl 1 db_ext_stat_$db_ext_stat_ ext static aligned, 1 10 1 11 2 debug_input char (32) aligned, /* Input switch name. Initially "user_input" */ 1 12 2 debug_output char (32) aligned, /* output switch name. Initially "user_output" */ 1 13 2 return_label label, /* The label used to do a non local goto out of debug when 1 14* it was entered via a fault. It will go to debug in 1 15* another frame. */ 1 16 1 17 2 debug_io_ptr (2) ptr, /* pointers to iocb for i/o 1 18* 1 = input switch iocb ptr 1 19* 2 = output switch iocb ptr */ 1 20 2 flags aligned, 1 21 3 debug_io_attach (2) bit (1) unaligned, /* 1= debug made the attachment */ 1 22 3 debug_io_open (2) bit (1) unaligned, /* 1 = debug opened the switch */ 1 23 3 in_debug bit (1) unaligned, /* Switch for the any_other condition. 0 = send the 1 24* condition on; 1 = use the debug condition handler */ 1 25 3 static_handler_call bit (1) unal, /* ON if mme2 call from static handler */ 1 26 3 pad bit (30) unaligned; /* Reserved for future use */ 1 27 dcl db_ext_stat_$break_instructions (9) bit (36) ext static aligned; 1 28 1 29 /* END OF INCLUDE FILE ... db_ext_stat_.incl.pl1 */ 50 51 dcl ioa_$ioa_stream ext entry options(variable); 52 53 54 dcl (binary,addrel,index,substr, rel, null) builtin; 55 /* */ 2 1 /* BEGIN INCLUDE FILE ... db_snt.incl.pl1 Last modified Nov 1972. WSS */ 2 2 /* Modified 8/75 to add internal static pointer by S.E. Barr */ 2 3 2 4 2 5 /* Overlay of segment name table. */ 2 6 2 7 dcl sntp ptr; /* Pointer to segment name table. */ 2 8 2 9 dcl 1 snt based (sntp) aligned, 2 10 2 ent_pt_name char(32), /* Entry point name. */ 2 11 2 ent_name char(32), /* Entry name of segment. */ 2 12 2 dir_name char(168), /* Directory name. */ 2 13 2 pp ptr, /* Pointer to current procedure. */ 2 14 2 sp ptr, /* Pointer to current stack frame. */ 2 15 2 lp ptr, /* Pointer to linkage section. */ 2 16 2 symp ptr, /* Pointer to current symbol table block. */ 2 17 2 symflag bit(1) unal, /* ON => no symbol table defined. */ 2 18 2 std bit(1) unal, /* ON => standard symbol header. */ 2 19 2 headp ptr, /* Pointer to current symbol header. */ 2 20 2 static_ptr ptr; /* Pointer to current static section. */ 2 21 2 22 /* END OF INCLUDE FILE... db_snt.incl.pl1 */ 56 57 /* */ 3 1 dcl 1 std_symbol_header based aligned, 3 2 2 dcl_version fixed bin, 3 3 2 identifier char(8), 3 4 2 gen_number fixed bin, 3 5 2 gen_created fixed bin(71), 3 6 2 object_created fixed bin(71), 3 7 2 generator char(8), 3 8 2 gen_version unaligned, 3 9 3 offset bit(18), 3 10 3 size bit(18), 3 11 2 userid unaligned, 3 12 3 offset bit(18), 3 13 3 size bit(18), 3 14 2 comment unaligned, 3 15 3 offset bit(18), 3 16 3 size bit(18), 3 17 2 text_boundary bit(18) unaligned, 3 18 2 stat_boundary bit(18) unaligned, 3 19 2 source_map bit(18) unaligned, 3 20 2 area_pointer bit(18) unaligned, 3 21 2 backpointer bit(18) unaligned, 3 22 2 block_size bit(18) unaligned, 3 23 2 next_block bit(18) unaligned, 3 24 2 rel_text bit(18) unaligned, 3 25 2 rel_def bit(18) unaligned, 3 26 2 rel_link bit(18) unaligned, 3 27 2 rel_symbol bit(18) unaligned, 3 28 2 mini_truncate bit(18) unaligned, 3 29 2 maxi_truncate bit(18) unaligned; 58 59 60 4 1 dcl 1 frame aligned based, 4 2 2 pointers(0:7) ptr, 4 3 2 back ptr, 4 4 2 next ptr, 4 5 2 return ptr, 4 6 2 entry ptr, 4 7 2 operator ptr, 4 8 2 argptr ptr, 4 9 2 skip1(2) fixed bin, 4 10 2 on_unit_info(2) bit(18) unaligned, 4 11 2 translator_id bit(18) unaligned, 4 12 2 operator_return bit(18) unaligned, 4 13 2 display ptr, 4 14 2 skip2(2) fixed bin, 4 15 2 linkage ptr; 61 62 /* */ 5 1 dcl 1 pl1_symbol_block aligned based, 5 2 2 version fixed bin, 5 3 2 identifier char(8), /* must be "pl1info" */ 5 4 2 flags, 5 5 3 profile bit(1) unal, 5 6 3 table bit(1) unal, 5 7 3 map bit(1) unal, 5 8 3 flow bit(1) unal, 5 9 3 io bit(1) unal, 5 10 3 table_removed bit(1) unal, 5 11 3 long_profile bit(1) unal, 5 12 3 pad bit(29) unal, 5 13 2 greatest_severity fixed bin, 5 14 2 root unal bit(18), 5 15 2 profile unal bit(18), 5 16 2 map unal, 5 17 3 first bit(18), 5 18 3 last bit(18), 5 19 2 segname unaligned, 5 20 3 offset bit(18), 5 21 3 size bit(18); 63 64 /* */ 6 1 dcl 1 symbol_header aligned based, 6 2 2 translator, /* dope for translator name */ 6 3 3 offset fixed bin(35), 6 4 3 code unal bit(9), 6 5 3 size unal bit(27), 6 6 2 version, /* dope for version name */ 6 7 3 offset fixed bin(35), 6 8 3 code unal bit(9), 6 9 3 size unal bit(27), 6 10 2 times, 6 11 3 creation fixed bin(71), 6 12 3 translation fixed bin(71), 6 13 2 root unal bit(18), 6 14 2 extension unal bit(18), 6 15 2 map unal bit(18), 6 16 2 n_files unal bit(18), 6 17 2 next_header unal bit(18), 6 18 2 bind_indicator unal bit(18), 6 19 2 text_size unal bit(18), 6 20 2 link_size unal bit(18), 6 21 2 program, /* dope for program name */ 6 22 3 offset fixed bin(35), 6 23 3 code unal bit(9), 6 24 3 size unal bit(27); 65 66 /* */ 7 1 dcl 1 symbol_node aligned based, 7 2 2 type unal bit(12), /* data type */ 7 3 2 level unal bit(6), /* structure level */ 7 4 2 ndims unal bit(6), /* number of dimensions */ 7 5 2 bits unal, 7 6 3 aligned bit(1), 7 7 3 packed bit(1), 7 8 3 simple bit(1), 7 9 3 decimal bit(1), 7 10 2 scale unal bit(8), /* arithmetic scale factor */ 7 11 2 name unal bit(18), /* rel ptr to acc name */ 7 12 2 brother unal bit(18), /* rel ptr to brother entry */ 7 13 2 father unal bit(18), /* rel ptr to father entry */ 7 14 2 son unal bit(18), /* rel ptr to son entry */ 7 15 2 address unal, 7 16 3 offset bit(18), /* offset in storage class */ 7 17 3 class bit(4), /* storage class */ 7 18 3 next bit(14), /* rel ptr to next of same class */ 7 19 2 size fixed bin(35), /* encoded string|arith size */ 7 20 2 word_offset fixed bin(35), /* encoded offset from address */ 7 21 2 bit_offset fixed bin(35), 7 22 2 virtual_org fixed bin(35), 7 23 2 bounds(1), 7 24 3 lower fixed bin(35), /* encoded lower bound */ 7 25 3 upper fixed bin(35), /* encoded upper bound */ 7 26 3 multiplier fixed bin(35); /* encoded multiplier */ 7 27 7 28 dcl 1 sym_bound based, 7 29 2 lower fixed bin(35), 7 30 2 upper fixed bin(35), 7 31 2 multiplier fixed bin(35); 7 32 7 33 dcl 1 symbol_block aligned based, 7 34 2 type unal bit(12), /* = 0 for a block node */ 7 35 2 number unal bit(6), /* begin block number */ 7 36 2 start unal bit(18), /* rel ptr to start of symbols */ 7 37 2 name unal bit(18), /* rel ptr to name of proc */ 7 38 2 brother unal bit(18), /* rel ptr to brother block */ 7 39 2 father unal bit(18), /* rel ptr to father block */ 7 40 2 son unal bit(18), /* rel ptr to son block */ 7 41 2 map unal, 7 42 3 first bit(18), /* rel ptr to first word of map */ 7 43 3 last bit(18), /* rel ptr to last word of map */ 7 44 2 bits unal bit(18), 7 45 2 header unal bit(18), /* rel ptr to symbol header */ 7 46 2 chain(4) unal bit(18), /* chain(i) is rel ptr to first symbol 7 47* on start list with length >= 2**i */ 7 48 2 class_list(0:15) unal bit(18); /* rel ptrs to first symbol of given 7 49* storage class */ 67 68 /* */ 69 70 sntp = a_sntp; /* Copy argument. Set pointer to segment name 71* * table overlay. */ 72 73 74 75 /* If the symbol table pointer in the segment name table is not null then it 76** is allready pointing to a symbol table block. 77**/ 78 79 if snt.symp ^= null() then return; 80 81 82 /* We have to look for the symbol table block. Set the flag in the segment 83** name table so that we won't look again unless someone else resets the 84** flag. 85**/ 86 snt.symflag = "0"b; 87 88 89 /* Now get the header of the symbol table. 90**/ 91 92 snt.std = "0"b; 93 hdr_ptr = stu_$find_header( snt.pp, snt.ent_pt_name, 0); 94 95 /* If we can't get the header to the symbol table then we will return. */ 96 97 snt.headp = hdr_ptr; 98 if hdr_ptr = null() then return; 99 100 101 /* If there is a pointer to the stack then we can extract the pointer to the 102** symbol table block from the stack information if necessary. 103**/ 104 if snt.sp ^= null() 105 106 then do; 107 108 if snt.pp = null() 109 then offset = binary (rel (snt.sp -> frame.entry), 18, 0); 110 /* Use entry ptr if there is no procedure ptr. */ 111 else offset = binary( rel(snt.pp), 18, 0); 112 113 snt.symp = stu_$find_containing_block (hdr_ptr, offset); 114 115 end; 116 117 118 119 /* Now get the offset of the root. */ 120 121 if hdr_ptr -> std_symbol_header.identifier ^= "symbtree" 122 123 124 then root = hdr_ptr ->symbol_header.root; 125 126 127 else do; 128 129 snt.std = "1"b; 130 if hdr_ptr -> std_symbol_header.area_pointer = (18)"0"b then return; 131 132 bp = addrel( hdr_ptr, hdr_ptr -> std_symbol_header.area_pointer ); 133 134 if bp -> pl1_symbol_block.identifier ^= "pl1info" 135 then return; 136 137 root = bp -> pl1_symbol_block.root; 138 139 end; 140 141 /* If we already got the symbol pointer from the stack frame we're done */ 142 143 if snt.sp ^= null() then return; 144 145 146 /* If the root block of the symbol table is not present then we will have to return. */ 147 148 if root = (18)"0"b then return; 149 150 /* We have a valid symbol table. We will search for the correct block as 151** identified by the entry name. If no block is found for this entry name then 152** we will use the first block off of the root block. 153**/ 154 len = index(snt.ent_pt_name," ") -1 ; /* Get length of entry name. */ 155 if len = -1 then len = 32; 156 157 work_ptr = stu_$find_block( hdr_ptr, substr(snt.ent_pt_name,1,len)); 158 159 if work_ptr = null() /* If no block found for this entry use 160* * the first son off of the root. */ 161 then do; 162 work_ptr = addrel(hdr_ptr, root); 163 work_ptr = addrel(work_ptr, work_ptr->symbol_block.son); 164 call ioa_$ioa_stream (debug_output, "Using symbol table of ^A for ^a", 165 addrel(work_ptr,work_ptr->symbol_block.name), snt.ent_pt_name); 166 end; 167 168 snt.symp = work_ptr; /* send back result */ 169 170 171 end db_get_sym; SOURCE FILES USED IN THIS COMPILATION. LINE NUMBER DATE MODIFIED NAME PATHNAME 0 11/02/83 1242.8 db_get_sym.pl1 >spec>on>pascal>db_get_sym.pl1 50 1 08/12/76 1010.2 db_ext_stat_.incl.pl1 >ldd>include>db_ext_stat_.incl.pl1 56 2 11/06/75 1110.0 db_snt.incl.pl1 >ldd>include>db_snt.incl.pl1 58 3 05/06/74 1751.6 std_symbol_header.incl.pl1 >ldd>include>std_symbol_header.incl.pl1 61 4 05/06/74 1752.6 stu_frame.incl.pl1 >ldd>include>stu_frame.incl.pl1 63 5 03/10/77 1345.4 pl1_symbol_block.incl.pl1 >ldd>include>pl1_symbol_block.incl.pl1 65 6 05/06/74 1752.6 symbol_header.incl.pl1 >ldd>include>symbol_header.incl.pl1 67 7 05/06/74 1752.6 symbol_node.incl.pl1 >ldd>include>symbol_node.incl.pl1 NAMES DECLARED IN THIS COMPILATION. IDENTIFIER OFFSET LOC STORAGE CLASS DATA TYPE ATTRIBUTES AND REFERENCES (* indicates a set context) NAMES DECLARED BY DECLARE STATEMENT. a_sntp parameter pointer dcl 27 ref 16 70 addrel builtin function dcl 54 ref 132 162 163 164 164 area_pointer 16(18) based bit(18) level 2 packed unaligned dcl 3-1 ref 130 132 binary builtin function dcl 54 ref 108 111 bp 000102 automatic pointer dcl 29 set ref 132* 134 137 db_ext_stat_$db_ext_stat_ 000016 external static structure level 1 dcl 1-9 debug_output 10 000016 external static char(32) level 2 dcl 1-9 set ref 164* ent_pt_name based char(32) level 2 dcl 2-9 set ref 93* 154 157 157 164* entry 26 based pointer level 2 dcl 4-1 ref 108 frame based structure level 1 dcl 4-1 hdr_ptr 000100 automatic pointer dcl 29 set ref 93* 97 98 113* 121 121 130 132 132 157* 162 headp 104 based pointer level 2 dcl 2-9 set ref 97* identifier 1 based char(8) level 2 in structure "pl1_symbol_block" dcl 5-1 in procedure "db_get_sym" ref 134 identifier 1 based char(8) level 2 in structure "std_symbol_header" dcl 3-1 in procedure "db_get_sym" ref 121 index builtin function dcl 54 ref 154 ioa_$ioa_stream 000020 constant entry external dcl 51 ref 164 len 000107 automatic fixed bin(17,0) dcl 36 set ref 154* 155 155* 157 157 name 1 based bit(18) level 2 packed unaligned dcl 7-33 ref 164 164 null builtin function dcl 54 ref 79 98 104 108 143 159 offset 000106 automatic fixed bin(18,0) dcl 36 set ref 108* 111* 113* pl1_symbol_block based structure level 1 dcl 5-1 pp 72 based pointer level 2 dcl 2-9 set ref 93* 108 111 rel builtin function dcl 54 ref 108 111 root 5 based bit(18) level 2 in structure "pl1_symbol_block" packed unaligned dcl 5-1 in procedure "db_get_sym" ref 137 root 10 based bit(18) level 2 in structure "symbol_header" packed unaligned dcl 6-1 in procedure "db_get_sym" ref 121 root 000110 automatic bit(18) unaligned dcl 36 in procedure "db_get_sym" set ref 121* 137* 148 162 snt based structure level 1 dcl 2-9 sntp 000112 automatic pointer dcl 2-7 set ref 70* 79 86 92 93 93 97 104 108 108 111 113 129 143 154 157 157 164 168 son 2(18) based bit(18) level 2 packed unaligned dcl 7-33 ref 163 sp 74 based pointer level 2 dcl 2-9 ref 104 108 143 std 102(01) based bit(1) level 2 packed unaligned dcl 2-9 set ref 92* 129* std_symbol_header based structure level 1 dcl 3-1 stu_$find_block 000014 constant entry external dcl 45 ref 157 stu_$find_containing_block 000010 constant entry external dcl 45 ref 113 stu_$find_header 000012 constant entry external dcl 45 ref 93 substr builtin function dcl 54 ref 157 157 symbol_block based structure level 1 dcl 7-33 symbol_header based structure level 1 dcl 6-1 symflag 102 based bit(1) level 2 packed unaligned dcl 2-9 set ref 86* symp 100 based pointer level 2 dcl 2-9 set ref 79 113* 168* work_ptr 000104 automatic pointer dcl 29 set ref 157* 159 162* 163* 163 163 164 164 164 164 168 NAMES DECLARED BY DECLARE STATEMENT AND NEVER REFERENCED. db_ext_stat_$break_instructions external static bit(36) array dcl 1-27 sym_bound based structure level 1 unaligned dcl 7-28 symbol_node based structure level 1 dcl 7-1 NAME DECLARED BY EXPLICIT CONTEXT. db_get_sym 000025 constant entry external dcl 16 THERE WERE NO NAMES DECLARED BY CONTEXT OR IMPLICATION. STORAGE REQUIREMENTS FOR THIS PROGRAM. Object Text Link Symbol Defs Static Start 0 0 404 426 312 414 Length 730 312 22 265 72 0 BLOCK NAME STACK SIZE TYPE WHY NONQUICK/WHO SHARES STACK FRAME db_get_sym 122 external procedure is an external procedure. STORAGE FOR AUTOMATIC VARIABLES. STACK FRAME LOC IDENTIFIER BLOCK NAME db_get_sym 000100 hdr_ptr db_get_sym 000102 bp db_get_sym 000104 work_ptr db_get_sym 000106 offset db_get_sym 000107 len db_get_sym 000110 root db_get_sym 000112 sntp db_get_sym THE FOLLOWING EXTERNAL OPERATORS ARE USED BY THIS PROGRAM. alloc_cs call_ext_out_desc call_ext_out return shorten_stack ext_entry THE FOLLOWING EXTERNAL ENTRIES ARE CALLED BY THIS PROGRAM. ioa_$ioa_stream stu_$find_block stu_$find_containing_block stu_$find_header THE FOLLOWING EXTERNAL VARIABLES ARE USED BY THIS PROGRAM. db_ext_stat_$db_ext_stat_ LINE LOC LINE LOC LINE LOC LINE LOC LINE LOC LINE LOC LINE LOC 16 000022 70 000032 79 000036 86 000042 92 000044 93 000046 97 000063 98 000066 104 000072 108 000076 111 000107 113 000112 121 000125 129 000136 130 000141 132 000144 134 000147 137 000155 143 000160 148 000165 154 000167 155 000177 157 000203 159 000231 162 000236 163 000242 164 000246 168 000303 171 000306 ----------------------------------------------------------- Historical Background This edition of the Multics software materials and documentation is provided and donated to Massachusetts Institute of Technology by Group BULL including BULL HN Information Systems Inc. as a contribution to computer science knowledge. This donation is made also to give evidence of the common contributions of Massachusetts Institute of Technology, Bell Laboratories, General Electric, Honeywell Information Systems Inc., Honeywell BULL Inc., Groupe BULL and BULL HN Information Systems Inc. to the development of this operating system. Multics development was initiated by Massachusetts Institute of Technology Project MAC (1963-1970), renamed the MIT Laboratory for Computer Science and Artificial Intelligence in the mid 1970s, under the leadership of Professor Fernando Jose Corbato. Users consider that Multics provided the best software architecture for managing computer hardware properly and for executing programs. Many subsequent operating systems incorporated Multics principles. Multics was distributed in 1975 to 2000 by Group Bull in Europe , and in the U.S. by Bull HN Information Systems Inc., as successor in interest by change in name only to Honeywell Bull Inc. and Honeywell Information Systems Inc. . ----------------------------------------------------------- Permission to use, copy, modify, and distribute these programs and their documentation for any purpose and without fee is hereby granted,provided that the below copyright notice and historical background appear in all copies and that both the copyright notice and historical background and this permission notice appear in supporting documentation, and that the names of MIT, HIS, BULL or BULL HN not be used in advertising or publicity pertaining to distribution of the programs without specific prior written permission. Copyright 1972 by Massachusetts Institute of Technology and Honeywell Information Systems Inc. Copyright 2006 by BULL HN Information Systems Inc. Copyright 2006 by Bull SAS All Rights Reserved