Changeset 8361 for trunk/tools


Ignore:
Timestamp:
May 1, 2002, 5:59:24 AM (23 years ago)
Author:
bird
Message:

Fixed some chocking on win32 map files.

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:42 bird Exp $
     1/* $Id: MapSym.cmd,v 1.5 2002-05-01 03:59:24 bird Exp $
    22 *
    33 * Helper script for calling MAPSYM.EXE.
     
    105105    when (sLinker = 'WATCOM') then
    106106    do
     107        /*sTmpMapFile = watos2.map*/
    107108        rc = wat2map(sMapFile, sTmpMapFile);
    108109        if (rc <> 0) then
     
    475476mapFile = arg1          /* Can be Null, in which case we pull from stdin. */
    476477outFile = arg2
     478fFlatMode = 0;
    477479
    478480/* erase outfile */  /* kill the old map file */
     
    513515   Return 4
    514516End
    515 junk = LineIn( mapFile )       /* Discard a couple lines of formatting. */
    516 junk = LineIn( mapFile )
    517 
     517
     518
     519junk = LineIn( mapFile )      /* Discard a couple lines of formatting. */
     520junk = LineIn( mapFile )      /* Discard a couple lines of formatting. */
    518521/*--- 4.  Translate segment table.  ---*/
     522/*"Segment                Class          Group          Address         Size"*/
     523iClass = pos('Class', watcomText);
     524iGroup = pos('Group', watcomText);
     525iAddress = pos('Address', watcomText);
     526iSize = pos('Size', watcomText);
     527
    519528call lineout outfile , " Start         Length     Name                   Class"  /* bird bird bird fixed!!! */
    520529Do While Lines( mapFile ) <> 0
    521530   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));
    523533   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     '
    525544   segName = Left( segName, 23 )
    526545   call lineout outfile ,' ' || address || ' ' || length || segName || className
     
    538557Do While Lines( mapFile ) <> 0
    539558   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*/
    541566   is_Adress = (is_Hex(seg) = 1) & (is_Hex(ofs) = 1)
    542567   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 
    545568      /*--- Haven't done the work to xlate operator symbols - skip the line. */
    546569      If Pos( '::operator', declaration ) <> 0 Then Iterate;
     
    578601   do
    579602       parse var watcomText 'Entry point address:' sEntryPoint
     603       if (pos(':', sEntryPoint) <= 0) then
     604           sEntryPoint = '0001:'||strip(sEntryPoint);
    580605       call lineout outfile, ''
    581606       call lineout outfile, 'Program entry point at' strip(sEntryPoint)
Note: See TracChangeset for help on using the changeset viewer.