1 $! Analyze Map for OpenVMS AXP
3 $! Originally found in the distribution of gv
4 $! http://wwwthep.physik.uni-mainz.de/~plass/gv/
6 $! 1-Jul-1999 : modified to be used with $BSS$ & $READONLY sections in the
7 $! map-file by J. Jansen (joukj@hrem.stm.tudelft.nl)
9 $ SET SYMBOL/GENERAL/SCOPE=(NOLOCAL,NOGLOBAL)
10 $ SAY := "WRITE_ SYS$OUTPUT"
12 $ IF F$SEARCH("''P1'") .EQS. ""
14 $ SAY " ANALYZE_MAP.COM: Error, no mapfile provided"
19 $ SAY " ANALYZE_MAP.COM: Error, no output file provided"
23 $ LINK_TMP = F$PARSE(P2,,,"DEVICE")+F$PARSE(P2,,,"DIRECTORY")+F$PARSE(P2,,,"NAME")+".TMP"
25 $ SAY " checking PSECT list in ''P2'"
28 $ READ_/END=EOF_PSECT IN REC
30 $ if F$EXTRACT(0,5,REC) .eqs. "$DATA" .or. F$EXTRACT(0,5,REC) .eqs. -
31 "$BSS$" .or. f$extract(0,10,rec) .eqs. "$READONLY$" then goto do_data
32 $ if F$EXTRACT(0,14,REC) .eqs. "$READONLY_ADDR" then goto do_readonly
33 $ goto LOOP_PSECT_SEARCH
37 $ READ_/END=EOF_PSECT IN REC
38 $ if F$EXTRACT(0,1,REC) .eqs. "$" .and. F$EXTRACT(0,5,REC) .nes. "$DATA" -
39 .and. F$EXTRACT(0,5,REC) .nes. "$BSS$" .and. f$extract(0,10,rec) -
40 .nes. "$READONLY$" then goto LOOP_PSECT_SEARCH0
41 $ if REC - "NOPIC,OVR,REL,GBL,NOSHR,NOEXE, WRT,NOVEC" .nes. REC
43 $ J = F$LOCATE(" ",REC)
44 $ S = F$EXTRACT(0,J,REC)
45 $ IF S .EQS. LAST THEN GOTO LOOP_PSECT
49 $ if REC - "NOPIC,OVR,REL,GBL,NOSHR,NOEXE,NOWRT,NOVEC" .nes. REC
51 $ J = F$LOCATE(" ",REC)
52 $ S = F$EXTRACT(0,J,REC)
53 $ IF S .EQS. LAST THEN GOTO LOOP_PSECT
62 $ READ_/END=EOF_PSECT IN REC
63 $ if F$EXTRACT(0,1,REC) .eqs. "-" .or. F$EXTRACT(0,3,REC) .eqs. "NL:" then -
65 $ if F$EXTRACT(0,1,REC) .eqs. "$" .and. F$EXTRACT(0,14,REC) .nes. -
66 "$READONLY_ADDR" then goto LOOP_PSECT_SEARCH0
67 $ if REC - "OCTA" .nes. REC
69 $ J = F$LOCATE(" ",REC)
70 $ S = F$EXTRACT(0,J,REC)
71 $ IF S .EQS. LAST THEN GOTO LOOP_PSECT3
80 $ SAY " appending list of UNIVERSAL procedures to ''P2'"
81 $ SEARCH_/NOHIGH/WINDOW=(0,0) 'P1' " R-"/OUT='LINK_TMP
82 $ OPEN_/READ IN 'LINK_TMP
83 $ OPEN_/write OUT 'P2'
85 $ WRITE_ OUT "! ### UNIVERSAL procedures and global definitions extracted from ''P1'"
87 $ write_ OUT "case_sensitive=YES"
89 $ READ_/END=EOF_UNIVERSAL IN REC
90 $ J = F$LOCATE(" R-",REC)
91 $ S = F$EXTRACT(J+3,F$length(rec),REC)
93 $ S = F$EXTRACT(0,J,S)
95 $ IF F$TYPE(P$_'S').EQS.""
97 $ WRITE_ OUT "symbol_vector = ("+S+" = PROCEDURE)"
99 $ WRITE_ OUT "symbol_vector = ("+S+" = DATA)"
101 $ GOTO LOOP_UNIVERSAL
106 $ SAY " creating PSECT list in ''P2'"
108 $ OPEN_/append OUT 'P2'
110 $ WRITE_ OUT "! ### PSECT list extracted from ''P1'"
112 $ LOOP_PSECT_SEARCH1:
113 $ READ_/END=EOF_PSECT1 IN REC
114 $ if F$EXTRACT(0,5,REC) .nes. "$DATA" .and. F$EXTRACT(0,5,REC) .nes. -
115 "$BSS$" .and. f$extract(0,10,rec) .nes. "$READONLY$" then goto -
119 $ READ_/END=EOF_PSECT1 IN REC
120 $ if F$EXTRACT(0,1,REC) .eqs. "$" .and. F$EXTRACT(0,5,REC) .nes. "$DATA" -
121 .and. F$EXTRACT(0,5,REC) .nes. "$BSS$" .and. f$extract(0,10,rec) -
122 .nes. "$READONLY$" then goto LOOP_PSECT_SEARCH1
123 $ if REC - "NOPIC,OVR,REL,GBL,NOSHR,NOEXE, WRT,NOVEC" .nes. REC
125 $ J = F$LOCATE(" ",REC)
126 $ S = F$EXTRACT(0,J,REC)
127 $ IF S .EQS. LAST THEN GOTO LOOP_PSECT1
128 $ IF F$TYPE(PP$_'S').nes."" then WRITE_ OUT "symbol_vector = (" + S + " = PSECT)"
132 $ if REC - "NOPIC,OVR,REL,GBL,NOSHR,NOEXE,NOWRT,NOVEC" .nes. REC
134 $ J = F$LOCATE(" ",REC)
135 $ S = F$EXTRACT(0,J,REC)
136 $ IF S .EQS. LAST THEN GOTO LOOP_PSECT1
137 $ IF F$TYPE(PP$_'S').nes."" then WRITE_ OUT "symbol_vector = (" + S + " = PSECT)"
146 $ if f$search("''LINK_TMP'") .nes. "" then DELETE_/NOLOG/NOCONFIRM 'LINK_TMP';*