Changeset 1167


Ignore:
Timestamp:
Feb 9, 2018, 9:52:57 AM (3 years ago)
Author:
Dmitry A. Kuminov
Message:

OS/2: wmapsym.cmd: Add /m switch and improve compatibility with IBM map.

The /m switch will only produce the IBM map file without calling MAPSYM on it.
Improved compatibility means proper generation of the Class column's values
for the segments table which is needed for the IBM MAPTSF tool.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/mkspecs/os2-g++/wmapsym.cmd

    r1106 r1167  
    4141G.StartDir = directory()
    4242
    43 parse arg aArgs
    44 if (aArgs == '') then do
     43parse arg G.WatMapFile aOpts
     44if (G.WatMapFile == '') then do
    4545    say
    4646    say 'Creates a .SYM file from the Watcom .MAP file using IBM MAPSYM'
    47     say 'Version 1.1 (2011-12-18)'
    48     say 'Copyright (C) 2011 Dmitriy Kuminov'
     47    say 'Version 1.2 (2018-02-09)'
     48    say 'Copyright (C) 2018 Dmitriy Kuminov'
    4949    say
    5050    say 'Usage: '
    5151    say
    52     say '  'G.ScriptFile' <watcom_map_file>'
     52    say '  'G.ScriptFile' <watcom_map_file> [/m]'
     53    say
     54    say '  /m - Don''t run MAPSYM and only produce an IBM map file (.NNNNN-map)'
    5355
    5456    call Done 0
    5557end
    5658
    57 G.WatMapFile = aArgs
     59G.MapOnly = 0
     60if (translate(aOpts) == '/m') then G.MapOnly = 1
    5861
    5962call Main
     
    199202                        call lineout G.IbmMapFile, ' Start         Length     Name                   Class'
    200203                        do i = 1 to segments.0
    201                             call lineout G.IbmMapFile, ' 'segments.i.!addr' 0'segments.i.!size'H 'segments.i.!name
     204
     205                            call lineout G.IbmMapFile, ' 'segments.i.!addr' 0'segments.i.!size'H 'AlignLeft(segments.i.!name, 22) segments.i.!class '32-bit'
    202206                        end
    203207                        call lineout G.IbmMapFile, ''
     
    235239    call lineout G.IbmMapFile
    236240
     241    if (G.MapOnly) then do
     242        say 'Created IBM map file:' G.IbmMapFile
     243        return
     244    end
     245
    237246    cmdline = 'mapsym.exe' G.IbmMapFile
    238247    cmdline
     
    251260 utility functions
    252261------------------------------------------------------------------------------*/
     262
     263/**
     264 * Pad the given string with the pad character on the right to the requested
     265 * width. If the string length is equal or greater than the requested width, it
     266 * is returned as is.
     267 *
     268 * @param  aStr         String to align.
     269 * @param  aWidth       Minimum width of the resulting stiring.
     270 * @param  aPad h       Pad character (blank by default).
     271 * @return              Resulting string.
     272 */
     273AlignLeft: procedure expose (Globals)
     274    parse arg aStr, aWidth, aPad
     275    len = length(aStr)
     276    if (len >= aWidth) then return aStr
     277    if (aPad == "") then aPad = " "
     278    return aStr || copies(aPad, aWidth - len)
    253279
    254280/**
Note: See TracChangeset for help on using the changeset viewer.