COMPILATION LISTING OF SEGMENT get_runtime_line_no Compiled by: Multics PL/I Compiler, Release 28d, of October 4, 1983 Compiled at: Honeywell LCPD Phoenix, System M Compiled on: 11/02/83 1309.5 mst Wed 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 get_runtime_line_no: proc (head_pt, offset, start, num, line_no); 11 12 /* Procedure to get a line number corresponding to a given offset in 13* a standard object segment. By using the symbol header, it avoids 14* problems with internal procedures. 15* 16* Coded 9 March 1973 by Robert S. Coren. 17* Modeled on stu_$get_line_no by BLW. 18* 19* Modified: 21 June 1974 by J.M. Broughton to fix stu_$get_line of several lines 20**/ 21 22 23 dcl head_pt ptr; /* pointer to standard symbol header */ 24 dcl offset fixed bin (18); /* offset in text (input) */ 25 dcl start fixed bin (18); /* location where code for source line starts(output) */ 26 dcl num fixed bin (18); /* number of words in line (output) */ 27 dcl line_no fixed bin (18); /* line number (output) */ 28 29 dcl stu_$get_statement_map entry (ptr, ptr, ptr, fixed bin); 30 31 dcl map_pt ptr; 32 dcl end_pt ptr; 33 dcl inc fixed bin; 34 dcl extra fixed bin; 35 36 dcl (ln, loc) fixed bin (18); 37 dcl ll fixed bin; 38 dcl lim fixed bin; 39 40 dcl (addrel, fixed, null, string) builtin; 41 42 1 1 dcl 1 statement_map aligned based, 1 2 2 location bit(18) unaligned, 1 3 2 source_id unaligned, 1 4 3 file bit(8), 1 5 3 line bit(14), 1 6 3 statement bit(5), 1 7 2 source_info unaligned, 1 8 3 start bit(18), 1 9 3 length bit(9); 43 44 45 46 47 48 extra = 0; 49 join: 50 line_no = -1; 51 call stu_$get_statement_map (head_pt, map_pt, end_pt, inc); 52 if map_pt = null then go to no; 53 54 55 /* search through the statement map for the entry nearest offset */ 56 57 do while (map_pt ^= end_pt); 58 59 ln = fixed (map_pt -> statement_map.source_id.line, 14); 60 loc = fixed (map_pt -> statement_map.location, 18); 61 62 if loc <= offset then do; 63 if line_no ^= ln then do; /* first statement on line */ 64 if extra ^= 0 then do; /* for "stu_$get_line" entry */ 65 line_offset = fixed (map_pt -> statement_map.source_info.start, 66 18); 67 file = fixed (map_pt -> statement_map.source_id.file, 8); 68 end; 69 70 else start = loc; 71 72 line_no = ln; 73 end; 74 75 end; 76 77 78 else do; 79 if line_no = ln then go to step; /* more statements on the line */ 80 if line_no = -1 then go to no; /* past it without finding one */ 81 if extra = 0 then num = loc - start; 82 83 else do; /* add on however many lines were requested */ 84 lim = line_no + n_lines; 85 do while (ln < lim); 86 if string (map_pt -> statement_map.source_id) = 87 (27)"1"b then go to done; /* don't use dummy entry */ 88 map_pt = addrel (map_pt, inc); 89 ln = fixed (map_pt -> statement_map.source_id.line, 14); 90 end; 91 92 done: map_pt = addrel (map_pt, -inc); /* look at last good one */ 93 line_length = fixed (map_pt -> statement_map.source_info.start, 18) + 94 fixed (map_pt -> statement_map.source_info.length, 9) - 95 line_offset; 96 97 end; 98 99 return; 100 end; 101 102 step: 103 map_pt = addrel (map_pt, inc); /* look at next statement map entry */ 104 end; 105 106 107 no: 108 line_no = -1; 109 if extra = 0 then 110 start = -1; 111 return; 112 113 114 115 116 117 get_line: entry (head_pt, offset, n_lines, line_no, line_offset, line_length, file); 118 119 /* This entry is used to return info about the line useful for printing it */ 120 121 dcl line_offset fixed bin (18); 122 dcl line_length fixed bin; 123 dcl n_lines fixed bin; /* number of lines caller wants to print */ 124 dcl file fixed bin; 125 126 127 ll = 0; 128 extra = 1; /* indicate stu_$get_line entry */ 129 go to join; 130 131 end get_runtime_line_no; SOURCE FILES USED IN THIS COMPILATION. LINE NUMBER DATE MODIFIED NAME PATHNAME 0 11/02/83 1237.0 get_runtime_line_no.pl1 >spec>on>pascal>get_runtime_line_no.pl1 43 1 05/06/74 1751.6 statement_map.incl.pl1 >ldd>include>statement_map.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. addrel builtin function dcl 40 ref 88 92 102 end_pt 000102 automatic pointer dcl 32 set ref 51* 57 extra 000105 automatic fixed bin(17,0) dcl 34 set ref 48* 64 81 109 128* file 0(18) based bit(8) level 3 in structure "statement_map" packed unaligned dcl 1-1 in procedure "get_runtime_line_no" ref 67 file parameter fixed bin(17,0) dcl 124 in procedure "get_runtime_line_no" set ref 67* 117 fixed builtin function dcl 40 ref 59 60 65 67 89 93 93 head_pt parameter pointer dcl 23 set ref 10 51* 117 inc 000104 automatic fixed bin(17,0) dcl 33 set ref 51* 88 92 102 length 1(27) based bit(9) level 3 packed unaligned dcl 1-1 ref 93 lim 000111 automatic fixed bin(17,0) dcl 38 set ref 84* 85 line 0(26) based bit(14) level 3 packed unaligned dcl 1-1 ref 59 89 line_length parameter fixed bin(17,0) dcl 122 set ref 93* 117 line_no parameter fixed bin(18,0) dcl 27 set ref 10 49* 63 72* 79 80 84 107* 117 line_offset parameter fixed bin(18,0) dcl 121 set ref 65* 93 117 ll 000110 automatic fixed bin(17,0) dcl 37 set ref 127* ln 000106 automatic fixed bin(18,0) dcl 36 set ref 59* 63 72 79 85 89* loc 000107 automatic fixed bin(18,0) dcl 36 set ref 60* 62 70 81 location based bit(18) level 2 packed unaligned dcl 1-1 ref 60 map_pt 000100 automatic pointer dcl 31 set ref 51* 52 57 59 60 65 67 86 88* 88 89 92* 92 93 93 102* 102 n_lines parameter fixed bin(17,0) dcl 123 ref 84 117 null builtin function dcl 40 ref 52 num parameter fixed bin(18,0) dcl 26 set ref 10 81* offset parameter fixed bin(18,0) dcl 24 ref 10 62 117 source_id 0(18) based structure level 2 packed unaligned dcl 1-1 ref 86 source_info 1(09) based structure level 2 packed unaligned dcl 1-1 start 1(09) based bit(18) level 3 in structure "statement_map" packed unaligned dcl 1-1 in procedure "get_runtime_line_no" ref 65 93 start parameter fixed bin(18,0) dcl 25 in procedure "get_runtime_line_no" set ref 10 70* 81 109* statement_map based structure level 1 dcl 1-1 string builtin function dcl 40 ref 86 stu_$get_statement_map 000010 constant entry external dcl 29 ref 51 NAMES DECLARED BY EXPLICIT CONTEXT. done 000155 constant label dcl 92 ref 86 get_line 000216 constant entry external dcl 117 get_runtime_line_no 000013 constant entry external dcl 10 join 000024 constant label dcl 49 ref 129 no 000200 constant label dcl 107 ref 52 80 step 000174 constant label dcl 102 ref 79 THERE WERE NO NAMES DECLARED BY CONTEXT OR IMPLICATION. STORAGE REQUIREMENTS FOR THIS PROGRAM. Object Text Link Symbol Defs Static Start 0 0 302 314 234 312 Length 500 234 12 150 46 0 BLOCK NAME STACK SIZE TYPE WHY NONQUICK/WHO SHARES STACK FRAME get_runtime_line_no 87 external procedure is an external procedure. STORAGE FOR AUTOMATIC VARIABLES. STACK FRAME LOC IDENTIFIER BLOCK NAME get_runtime_line_no 000100 map_pt get_runtime_line_no 000102 end_pt get_runtime_line_no 000104 inc get_runtime_line_no 000105 extra get_runtime_line_no 000106 ln get_runtime_line_no 000107 loc get_runtime_line_no 000110 ll get_runtime_line_no 000111 lim get_runtime_line_no THE FOLLOWING EXTERNAL OPERATORS ARE USED BY THIS PROGRAM. call_ext_out return ext_entry THE FOLLOWING EXTERNAL ENTRIES ARE CALLED BY THIS PROGRAM. stu_$get_statement_map NO EXTERNAL VARIABLES ARE USED BY THIS PROGRAM. LINE LOC LINE LOC LINE LOC LINE LOC LINE LOC LINE LOC LINE LOC 10 000006 48 000023 49 000024 51 000026 52 000044 57 000050 59 000054 60 000062 62 000065 63 000070 64 000073 65 000075 67 000101 68 000105 70 000106 72 000110 75 000112 79 000113 80 000116 81 000120 84 000126 85 000131 86 000135 88 000144 89 000147 90 000154 92 000155 93 000161 99 000173 102 000174 104 000177 107 000200 109 000202 111 000207 117 000210 127 000226 128 000227 129 000231 ----------------------------------------------------------- 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