Changeset 490
- Timestamp:
- Jun 22, 2010, 1:27:23 AM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
OCO/trunk/tools/wat2map.cmd
r89 r490 136 136 /* call lineout outfile ,' '*/ 137 137 138 LineTbl.0=0; 139 LineIX = 0; 138 140 Do While Lines( mapFile ) <> 0 139 141 watcomText = LineIn( mapFile ) 140 142 Parse Value watcomText With seg ':' ofs declaration 143 if length(ofs) = 5 then 144 ofs = left(ofs, 4) || strip(translate(right(ofs, 1),, '+*')) 141 145 if length(ofs) = 9 then 142 146 ofs = left(ofs, 8) || strip(translate(right(ofs, 1),, '+*')) … … 155 159 156 160 /*--- Strip array brackets if this is an array. */ 157 sqBracket = Pos( '[', declaration ) 161 sqBracket = Pos( '[', declaration ); 158 162 If sqBracket <> 0 159 163 Then declaration = Substr(declaration, 1, sqBracket-1); … … 161 165 /*--- Strip leading tokens from the function name. 162 166 Eg., remove function return type, near/far, etc. */ 163 declaration = Word( declaration, Words(declaration) ) 167 declaration = Word( declaration, Words(declaration) ); 164 168 165 169 /*--- Strip any remaining parens around function name. ---*/ 166 declaration = ReplaceSubstr( '(', ' ', declaration ) 167 declaration = ReplaceSubstr( ')', ' ', declaration ) 170 declaration = ReplaceSubstr( '(', ' ', declaration ); 171 declaration = ReplaceSubstr( ')', ' ', declaration ); 168 172 169 173 /*--- Debug kernel doesn't like symbol for scoping operator "::" 170 174 in symbol names. Replace :: with double underscore "__". ---*/ 171 declaration = ReplaceSubstr( '::', '__', declaration ) 175 declaration = ReplaceSubstr( '::', '__', declaration ); 172 176 173 177 /*--- Debug kernel doesn't like symbol for destructor "~" 174 178 in symbol names. Replace ~ with character "d" for "destructor. 175 179 Note destructor for a class will translate "A::~A" -> "A__dA". ---*/ 176 declaration = ReplaceSubstr( '~', 'd', declaration ) 180 declaration = ReplaceSubstr( '~', 'd', declaration ); 181 182 /* remove any trailing underscore */ 183 declaration = STRIP(declaration, 't', '_'); 184 185 /* remove the first underscore (if any) */ 186 if (LEFT(declaration,1) = '_') then do; 187 declaration = RIGHT(declaration, LENGTH(declaration)-1); 188 end; 177 189 178 190 fill = copies(' ', 7) 179 call lineout outfile ,' ' || seg || ':' || ofs || fill || declaration 191 LineIX = LineIX + 1; 192 LineTbl.LineIX = seg || ':' || ofs || fill || declaration; 193 LineTbl.0 = LineIX; 180 194 End; 181 195 End; /* End While through symbol section, end of input file. */ 196 197 198 /* Sort the data */ 199 do i=2 to LineTbl.0 200 t=LineTbl.i 201 do j=i-1 to 1 by -1 while t<LineTbl.j 202 k=j+1 203 LineTbl.k=LineTbl.j 204 end 205 j=j+1 206 LineTbl.j=t 207 end 208 209 /* output the data */ 210 do LineIX = 1 to LineTbl.0; 211 call lineout outfile , ' ' || LineTbl.LineIX; 212 end; 182 213 183 214 call stream mapfile, 'C', 'CLOSE'
Note:
See TracChangeset
for help on using the changeset viewer.