Changeset 8361 for trunk/tools
- Timestamp:
- May 1, 2002, 5:59:24 AM (23 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tools/bin/MapSym.cmd
r8356 r8361 1 /* $Id: MapSym.cmd,v 1. 4 2002-04-30 19:51:42bird Exp $1 /* $Id: MapSym.cmd,v 1.5 2002-05-01 03:59:24 bird Exp $ 2 2 * 3 3 * Helper script for calling MAPSYM.EXE. … … 105 105 when (sLinker = 'WATCOM') then 106 106 do 107 /*sTmpMapFile = watos2.map*/ 107 108 rc = wat2map(sMapFile, sTmpMapFile); 108 109 if (rc <> 0) then … … 475 476 mapFile = arg1 /* Can be Null, in which case we pull from stdin. */ 476 477 outFile = arg2 478 fFlatMode = 0; 477 479 478 480 /* erase outfile */ /* kill the old map file */ … … 513 515 Return 4 514 516 End 515 junk = LineIn( mapFile ) /* Discard a couple lines of formatting. */ 516 junk = LineIn( mapFile ) 517 517 518 519 junk = LineIn( mapFile ) /* Discard a couple lines of formatting. */ 520 junk = LineIn( mapFile ) /* Discard a couple lines of formatting. */ 518 521 /*--- 4. Translate segment table. ---*/ 522 /*"Segment Class Group Address Size"*/ 523 iClass = pos('Class', watcomText); 524 iGroup = pos('Group', watcomText); 525 iAddress = pos('Address', watcomText); 526 iSize = pos('Size', watcomText); 527 519 528 call lineout outfile , " Start Length Name Class" /* bird bird bird fixed!!! */ 520 529 Do While Lines( mapFile ) <> 0 521 530 watcomText = LineIn( mapFile ) 522 Parse Value watcomText With segName className groupName address size . 531 /* do it the hard way to make sure we support spaces segment names. */ 532 segName = strip(substr(watcomText, 1, iClass-1)); 523 533 If segName = "" Then Leave; /* Empty line, break from loop. */ 524 length = '0000' || Substr( size, 4, 5 ) || 'H ' 534 className = strip(substr(watcomText, iClass, iGroup-iClass)); 535 groupName = strip(substr(watcomText, iGroup, iAddress-iGroup)); 536 address = strip(substr(watcomText, iAddress, iSize-iAddress)); 537 size = strip(substr(watcomText, iSize)); 538 if (pos(':', address) <= 0) then /* NT binaries doesn't have a segment number. */ 539 do 540 fFlatMode = 1; 541 address = '0001:'||address; 542 end 543 length = right(strip(strip(size), 'L', '0'), 9, '0') || 'H ' 525 544 segName = Left( segName, 23 ) 526 545 call lineout outfile ,' ' || address || ' ' || length || segName || className … … 538 557 Do While Lines( mapFile ) <> 0 539 558 watcomText = LineIn( mapFile ) 540 Parse Value watcomText With seg ':' ofs 10 . 16 declaration 559 Parse Value watcomText With seg ':' ofs 14 . 16 declaration 560 if (fFlatMode) then 561 do 562 seg = '0001'; 563 Parse Value watcomText With ofs 9 . 16 declaration 564 end 565 /*say ofs '-'declaration*/ 541 566 is_Adress = (is_Hex(seg) = 1) & (is_Hex(ofs) = 1) 542 567 If ((is_Adress = 1) & (seg <> '0000')) Then Do; /* bird: skip symbols with segment 0. (__DOSseg__) */ 543 ofs = substr(watcomText, pos(':', watcomText)+1, 8); /* bird bird bird fixed!!! */544 545 568 /*--- Haven't done the work to xlate operator symbols - skip the line. */ 546 569 If Pos( '::operator', declaration ) <> 0 Then Iterate; … … 578 601 do 579 602 parse var watcomText 'Entry point address:' sEntryPoint 603 if (pos(':', sEntryPoint) <= 0) then 604 sEntryPoint = '0001:'||strip(sEntryPoint); 580 605 call lineout outfile, '' 581 606 call lineout outfile, 'Program entry point at' strip(sEntryPoint)
Note:
See TracChangeset
for help on using the changeset viewer.