COMPILATION LISTING OF SEGMENT find_containing_block Compiled by: Multics PL/I Compiler, Release 24c, of May 11, 1979 Compiled at: Honeywell LISD Phoenix, System M Compiled on: 06/29/79 1551.6 mst Fri Options: optimize map 1 /* ****************************************************** 2* * * 3* * * 4* * Copyright (c) 1972 by Massachusetts Institute of * 5* * Technology and Honeywell Information Systems, Inc. * 6* * * 7* * * 8* ****************************************************** */ 9 10 find_containing_block: procedure (header_ptr, location) returns (pointer); 11 12 /* This routine finds the block that physically contains a given location, and returns a pointer to 13* the symbol block for that block. It needs a pointer to the symbol header for the procedure to 14* find the root block from which to begin search. 15* 16* Initial Version: Unknown Person 17* Modified: 9 Sept 78 by James R. Davis to remove assumption that blocks are in text order 18**/ 19 20 21 22 dcl header_ptr pointer, /* pointer to symbol header of procedure */ 23 (addrel, fixed, null) builtin, 24 location fixed bin (35), /* location of interest */ 25 bp pointer, /* pointer to current block */ 26 p pointer; 27 28 29 30 if header_ptr = null then return (null); /* check for real symbol table */ 31 if header_ptr -> std_symbol_header.identifier ^= "symbtree" then return (null); 32 p = addrel (header_ptr, header_ptr -> std_symbol_header.area_pointer); 33 if p -> pl1_symbol_block.identifier ^= "pl1info" then return (null); 34 if p -> pl1_symbol_block.root = (18)"0"b then return (null); 35 p = addrel (header_ptr, p -> pl1_symbol_block.root); /* get pointer to root block */ 36 37 /* bp at all times points to the innermost block we KNOW we're in, 38* p points to the block being examined */ 39 40 bp = p; /* we must be in root */ 41 do while ("1"b); 42 if location >= fixed (addrel (p, p -> runtime_block.first) -> statement_map.location, 18) 43 & location <= fixed (addrel (p, fixed (p -> runtime_block.last) -2) -> statement_map.location, 18) 44 then do; /* we're inside this block */ 45 bp = p; 46 if bp -> runtime_block.son ^= (18) "0"b /* have we a son ? */ 47 then p = addrel (bp, bp -> runtime_block.son); /* examine it */ 48 else return (bp); /* can go no deeper */ 49 end; 50 else if p -> runtime_block.brother 51 then p = addrel (p, p -> runtime_block.brother); 52 else return (bp); 53 end; /* of search */ 54 55 56 1 1 dcl 1 std_symbol_header based aligned, 1 2 2 dcl_version fixed bin, 1 3 2 identifier char(8), 1 4 2 gen_number fixed bin, 1 5 2 gen_created fixed bin(71), 1 6 2 object_created fixed bin(71), 1 7 2 generator char(8), 1 8 2 gen_version unaligned, 1 9 3 offset bit(18), 1 10 3 size bit(18), 1 11 2 userid unaligned, 1 12 3 offset bit(18), 1 13 3 size bit(18), 1 14 2 comment unaligned, 1 15 3 offset bit(18), 1 16 3 size bit(18), 1 17 2 text_boundary bit(18) unaligned, 1 18 2 stat_boundary bit(18) unaligned, 1 19 2 source_map bit(18) unaligned, 1 20 2 area_pointer bit(18) unaligned, 1 21 2 backpointer bit(18) unaligned, 1 22 2 block_size bit(18) unaligned, 1 23 2 next_block bit(18) unaligned, 1 24 2 rel_text bit(18) unaligned, 1 25 2 rel_def bit(18) unaligned, 1 26 2 rel_link bit(18) unaligned, 1 27 2 rel_symbol bit(18) unaligned, 1 28 2 mini_truncate bit(18) unaligned, 1 29 2 maxi_truncate bit(18) unaligned; 57 2 1 /* BEGIN INCLUDE FILE ... runtime_symbol.incl.pl1 ... Modified 12/78 */ 2 2 2 3 dcl 1 runtime_symbol aligned based, 2 4 2 flag unal bit(1), /* always "1"b for Version II */ 2 5 2 use_digit unal bit(1), /* if "1"b and units are half words units are really digits */ 2 6 2 array_units unal bit(2), 2 7 2 units unal bit(2), /* addressing units */ 2 8 2 type unal bit(6), /* data type */ 2 9 2 level unal bit(6), /* structure level */ 2 10 2 ndims unal bit(6), /* number of dimensions */ 2 11 2 bits unal, 2 12 3 aligned bit(1), 2 13 3 packed bit(1), 2 14 3 simple bit(1), 2 15 3 decimal bit(1), 2 16 2 scale unal bit(8), /* arithmetic scale factor */ 2 17 2 name unal bit(18), /* rel ptr to acc name */ 2 18 2 brother unal bit(18), /* rel ptr to brother entry */ 2 19 2 father unal bit(18), /* rel ptr to father entry */ 2 20 2 son unal bit(18), /* rel ptr to son entry */ 2 21 2 address unal, 2 22 3 location bit(18), /* location in storage class */ 2 23 3 class bit(4), /* storage class */ 2 24 3 next bit(14), /* rel ptr to next of same class */ 2 25 2 size fixed bin(35), /* encoded string|arith size */ 2 26 2 offset fixed bin(35), /* encoded offset from address */ 2 27 2 virtual_org fixed bin(35), 2 28 2 bounds(1), 2 29 3 lower fixed bin(35), /* encoded lower bound */ 2 30 3 upper fixed bin(35), /* encoded upper bound */ 2 31 3 multiplier fixed bin(35); /* encoded multiplier */ 2 32 2 33 dcl 1 runtime_bound based, 2 34 2 lower fixed bin(35), 2 35 2 upper fixed bin(35), 2 36 2 multiplier fixed bin(35); 2 37 2 38 dcl 1 runtime_block aligned based, 2 39 2 flag unal bit(1), /* always "1"b for Version II */ 2 40 2 quick unal bit(1), /* "1"b if quick block */ 2 41 2 fortran unal bit(1), /* "1"b if fortran program */ 2 42 2 standard unal bit(1), /* "1"b if program has std obj segment */ 2 43 2 owner_flag unal bit(1), /* "1"b if block has valid owner field */ 2 44 2 skip unal bit(1), 2 45 2 type unal bit(6), /* = 0 for a block node */ 2 46 2 number unal bit(6), /* begin block number */ 2 47 2 start unal bit(18), /* rel ptr to start of symbols */ 2 48 2 name unal bit(18), /* rel ptr to name of proc */ 2 49 2 brother unal bit(18), /* rel ptr to brother block */ 2 50 2 father unal bit(18), /* rel ptr to father block */ 2 51 2 son unal bit(18), /* rel ptr to son block */ 2 52 2 map unal, 2 53 3 first bit(18), /* rel ptr to first word of map */ 2 54 3 last bit(18), /* rel ptr to last word of map */ 2 55 2 entry_info unal bit(18), /* info about entry of quick block */ 2 56 2 header unal bit(18), /* rel ptr to symbol header */ 2 57 2 chain(4) unal bit(18), /* chain(i) is rel ptr to first symbol 2 58* on start list with length >= 2**i */ 2 59 2 token(0:5) unal bit(18), /* token(i) is rel ptr to first token 2 60* on list with length >= 2 ** i */ 2 61 2 owner unal bit(18); /* rel ptr to owner block */ 2 62 2 63 dcl 1 runtime_token aligned based, 2 64 2 next unal bit(18), /* rel ptr to next token */ 2 65 2 dcl unal bit(18), /* rel ptr to first dcl of this token */ 2 66 2 size unal unsigned fixed bin (9), /* number of chars in token */ 2 67 2 string unal char(n refer(runtime_token.size)); 2 68 2 69 dcl 1 encoded_value aligned based, 2 70 2 flag bit (2) unal, 2 71 2 code bit (4) unal, 2 72 2 n1 bit (6) unal, 2 73 2 n2 bit (6) unal, 2 74 2 n3 bit (18) unal; 2 75 2 76 /* END INCLUDE FILE ... runtime_symbol.incl.pl1 */ 58 3 1 dcl 1 statement_map aligned based, 3 2 2 location bit(18) unaligned, 3 3 2 source_id unaligned, 3 4 3 file bit(8), 3 5 3 line bit(14), 3 6 3 statement bit(5), 3 7 2 source_info unaligned, 3 8 3 start bit(18), 3 9 3 length bit(9); 59 4 1 dcl 1 pl1_symbol_block aligned based, 4 2 2 version fixed bin, 4 3 2 identifier char(8), /* must be "pl1info" */ 4 4 2 flags, 4 5 3 profile bit(1) unal, 4 6 3 table bit(1) unal, 4 7 3 map bit(1) unal, 4 8 3 flow bit(1) unal, 4 9 3 io bit(1) unal, 4 10 3 table_removed bit(1) unal, 4 11 3 long_profile bit(1) unal, 4 12 3 pad bit(29) unal, 4 13 2 greatest_severity fixed bin, 4 14 2 root unal bit(18), 4 15 2 profile unal bit(18), 4 16 2 map unal, 4 17 3 first bit(18), 4 18 3 last bit(18), 4 19 2 segname unaligned, 4 20 3 offset bit(18), 4 21 3 size bit(18); 60 61 end find_containing_block; SOURCE FILES USED IN THIS COMPILATION. LINE NUMBER DATE MODIFIED NAME PATHNAME 0 06/29/79 1421.5 find_containing_block.pl1 >spec>online>mib060879>find_containing_block.pl1 57 1 05/06/74 1751.6 std_symbol_header.incl.pl1 >ldd>include>std_symbol_header.incl.pl1 58 2 03/14/79 1708.8 runtime_symbol.incl.pl1 >ldd>include>runtime_symbol.incl.pl1 59 3 05/06/74 1751.6 statement_map.incl.pl1 >ldd>include>statement_map.incl.pl1 60 4 03/10/77 1345.4 pl1_symbol_block.incl.pl1 >ldd>include>pl1_symbol_block.incl.pl1 NAMES DECLARED IN THIS COMPILATION. IDENTIFIER OFFSET LOC STORAGE CLASS DATA TYPE ATTRIBUTES AND REFERENCES NAMES DECLARED BY DECLARE STATEMENT. addrel builtin function internal dcl 22 ref 32 35 42 42 46 50 area_pointer 16(18) based bit(18) level 2 packed unaligned dcl 1-1 ref 32 bp 000100 automatic pointer dcl 22 set ref 40 45 46 46 46 48 52 brother 1(18) based bit(18) level 2 packed unaligned dcl 2-38 ref 50 50 first 3 based bit(18) level 3 packed unaligned dcl 2-38 ref 42 fixed builtin function internal dcl 22 ref 42 42 42 header_ptr parameter pointer dcl 22 ref 10 30 31 32 32 35 identifier 1 based char(8) level 2 dcl 4-1 ref 33 identifier 1 based char(8) level 2 dcl 1-1 ref 31 last 3(18) based bit(18) level 3 packed unaligned dcl 2-38 ref 42 location based bit(18) level 2 packed unaligned dcl 3-1 ref 42 42 location parameter fixed bin(35,0) dcl 22 ref 10 42 42 map 3 based structure level 2 packed unaligned dcl 2-38 null builtin function internal dcl 22 ref 30 30 31 33 34 p 000102 automatic pointer dcl 22 set ref 32 33 34 35 35 40 42 42 42 42 45 46 50 50 50 50 pl1_symbol_block based structure level 1 dcl 4-1 root 5 based bit(18) level 2 packed unaligned dcl 4-1 ref 34 35 runtime_block based structure level 1 dcl 2-38 son 2(18) based bit(18) level 2 packed unaligned dcl 2-38 ref 46 46 statement_map based structure level 1 dcl 3-1 std_symbol_header based structure level 1 dcl 1-1 NAMES DECLARED BY DECLARE STATEMENT AND NEVER REFERENCED. encoded_value based structure level 1 dcl 2-69 runtime_bound based structure level 1 unaligned dcl 2-33 runtime_symbol based structure level 1 dcl 2-3 runtime_token based structure level 1 dcl 2-63 NAME DECLARED BY EXPLICIT CONTEXT. find_containing_block 000022 constant entry external dcl 10 ref 10 THERE WERE NO NAMES DECLARED BY CONTEXT OR IMPLICATION. STORAGE REQUIREMENTS FOR THIS PROGRAM. Object Text Link Symbol Defs Static Start 0 0 210 220 161 220 Length 454 161 10 217 27 0 BLOCK NAME STACK SIZE TYPE WHY NONQUICK/WHO SHARES STACK FRAME find_containing_block 69 external procedure is an external procedure. THE FOLLOWING EXTERNAL OPERATORS ARE USED BY THIS PROGRAM. return signal ext_entry NO EXTERNAL ENTRIES ARE CALLED BY THIS PROGRAM. NO EXTERNAL VARIABLES ARE USED BY THIS PROGRAM. LINE LOC LINE LOC LINE LOC LINE LOC LINE LOC LINE LOC LINE LOC 10 000016 30 000027 31 000037 32 000050 33 000055 34 000066 35 000075 40 000077 42 000100 45 000125 46 000126 48 000137 49 000141 50 000142 52 000151 53 000154 61 000155 ----------------------------------------------------------- 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