Changeset 8369 for trunk/tools


Ignore:
Timestamp:
May 5, 2002, 9:03:32 PM (23 years ago)
Author:
bird
Message:

Corrected some stupid vac40 bugs.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tools/bin/MapSym.cmd

    r8361 r8369  
    1 /* $Id: MapSym.cmd,v 1.5 2002-05-01 03:59:24 bird Exp $
     1/* $Id: MapSym.cmd,v 1.6 2002-05-05 19:03:32 bird Exp $
    22 *
    33 * Helper script for calling MAPSYM.EXE.
     
    2323
    2424if (  (sDummy <> '') ,
    25     | (sSymFile = '') ,
     25    | (sMapFile = '') ,
    2626    | (pos(';'translate(sLinker)';', translate(sLinkers)) <= 0) ,
    2727    )
     
    3737    call syntax;
    3838    exit(16);
     39end
     40
     41sMapBaseName = filespec('name', sMapFile);
     42if (pos('.', sMapBaseName) > 0) then
     43    sMapBaseName = left(sMapBaseName, pos('.', sMapBaseName) - 1);
     44
     45if (sSymFile = '') then
     46do
     47    if (lastpos('.', filespec('name', sMapFile)) > 0) then
     48        sSymFile = left(sMapFile, lastpos('.', sMapFile)) || 'sym';
     49    else
     50        sSymFile = sMapFile || '.sym';
    3951end
    4052
     
    8193 *  to this file. And call mapsym on it.)
    8294 */
    83 sTmpMapFile = SysTempFileName(sTmp'\mapsym????.map');
     95sTmpMapFile = SysTempFileName(sTmp'\'||sMapBaseName||'.???');
    8496if (sTmpMapFile = '') then
    8597do
     
    175187 */
    176188syntax: procedure;
    177     say 'syntax: MapSym.cmd <linker> <mapfile> <symfile>';
     189    say 'syntax: MapSym.cmd <linker> <mapfile> [symfile]';
    178190    say '   linker      watcom, vac3xx, link386 or vac40. All $(BUILD_ENV).';
    179191    say '   mapfile     Name of the input map file.';
    180     say '   symfile     Name of the output sym file.';
     192    say '   symfile     Name of the output sym file. If not specified';
     193    say '               mapfile is used as a base name.';
    181194return 0;
    182195
     
    288301                if (sState = sNewState) then
    289302                do
     303                    sLine = translate(sLine, '', '"');
    290304                    if ((strip(sLine) <> '') & (pos('|', sLine) <= 0) & (pos('@', sLine) <= 0)) then
    291305                        call lineout sOutFile, sLine;
     
    398412    parse arg sStringHex
    399413/*    say 'HexToDec('sStringHex'):' strip(strip(sStringHex), 'L', '0')*/
    400 return x2d(strip(strip(sStringHex), 'L', '0'));
     414    sStringHex = strip(strip(sStringHex), 'L', '0');
     415    if (sStringHex = '') then
     416        sStringHex = 0;
     417return x2d(sStringHex);
    401418
    402419
     
    410427DecToHex: procedure
    411428    parse arg sStringDec
    412 return d2x(strip(strip(sStringDec), 'L', '0'));
     429    sStringDec = strip(strip(sStringDec), 'L', '0');
     430    if (sStringDec = '') then
     431        sStringDec = 0;
     432return d2x(sStringDec);
    413433
    414434
Note: See TracChangeset for help on using the changeset viewer.