Ignore:
Timestamp:
Nov 15, 2010, 4:33:25 AM (15 years ago)
Author:
Gregg Young
Message:

This code adds the semaphores to prevent a rescan from starting before the current one is finished; it fixes the double directory listing in the tree container and streamlines scanning. It update mapsym.pl to the latest version. Some code cleanup is included

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/debugtools/mapsymw.pl

    r1342 r1551  
    11#!perl -w
    2 # mapsymw - mapsym Watcom map files
    3 
    4 # Copyright (c) 2007, 2008 Steven Levine and Associates, Inc.
     2# mapsymw - mapsym wrapper Watcom map files
     3# $Id: $
     4# Copyright (c) 2007, 2010 Steven Levine and Associates, Inc.
    55# All rights reserved.
    6 
    7 # $TLIB$: $ &(#) %n - Ver %v, %f $
    8 # TLIB: $ $
    96
    107# This program is free software licensed under the terms of the GNU
     
    1916# 08 Nov 07 SHL Drop leading keywords from function definitions
    2017# 14 Dec 08 SHL Ensure symbols sorted by value - some apps care
     18# 03 May 10 SHL Comments
     19# 14 Jun 10 SHL Avoid missing C++ symbols
    2120
    2221# mapsym requires each segment to have at least 1 symbol
     
    165164      # Address        Symbol
    166165      # 0002:0004ae46+ ArcTextProc
     166      # 0002:0d11+     void near IoctlAudioCapability( __2bd9g9REQPACKET far *, short unsigned )
    167167      # Out
    168168      # 0        1         2         3         4         5         6
     
    171171      #  0000:00000000  Imp  WinEmptyClipbrd      (PMWIN.733)
    172172      #  0002:0001ED40       __towlower_dummy
    173       if (/^([[:xdigit:]]+):([[:xdigit:]]+)[+*]?\s+(\w+)$/) {
     173      if (/^([[:xdigit:]]+):([[:xdigit:]]+)[+*]?\s+(.+)$/) {
    174174        $segnum = $1;
    175175        $offset = $2;
     
    195195
    196196        # Convert C++ symbols to something mapsym will accept
     197        # warn "$sym\n";
    197198
    198199        $_ = $sym;
    199200
    200         # s/\bIdle\b/    /;     # Drop Idle keyword
    201         s/\(.*\).*$//;          # Drop (... tails
    202 
    203         s/::~/_x/;              # Replace ::~ with _x
    204         s/::/_/;                # Replace :: with _
     201        # s/\bIdle\b/    /;     # Drop Idle keyword - obsolete done later
     202        s/\(.*\).*$//;          # Drop (...) tails
     203
     204        s/::~/__x/;             # Replace ::~ with __x
     205        s/::/__/;               # Replace :: with __
    205206
    206207        s/[<,]/_/g;             # Replace < and , with _
    207208        s/[>]//g;               # Replace > with nothing
    208209        s/[\[\]]//g;            # Replace [] with nothing
    209         s/_*$//;                # Drop trailing _
    210         s/\W+\w//;              # Drop leading keywords (including Idle)
     210        # s/_*$//;              # Drop trailing _
     211        # s/\W+\w//;            # Drop leading keywords (including Idle)
     212        s/\b.*\b\s+//g;         # Drop leading keywords (including Idle)
    211213
    212214        # Drop leading and trailing _ to match source code
     
    214216        s/^_//;                 # Drop leading _ (cdecl)
    215217        s/_$//;                 # Drop trailing _ (watcall)
     218
     219        # warn "$_\n";
    216220
    217221        # Prune some libc symbols to avoid mapsym overflows
     
    242246  close MAPFILE;
    243247
    244   # Generate dummy symbols as needed
     248  # Sort segments
    245249
    246250  my @keys = sort keys %segsinfo;
     
    249253    @keys = '0000'..$maxseg;
    250254  }
     255
     256  # Generate dummy symbols for 32-bit segments smaller than 64KB
    251257
    252258  foreach $segnum (@keys) {
     
    280286  } # foreach
    281287
     288  # Generate symbols by value listing
     289
     290  my $lastsym = '';
     291  my $seq = 0;
    282292  @keys = sort keys %syms;
    283293  foreach $segaddr (@keys) {
    284294    my $sym = $syms{$segaddr};
    285295    my $imp = substr($segaddr, 0, 4) eq '0000' ? 'Imp' : '';
     296    if ($sym ne $lastsym) {
     297      $lastsym = $sym;
     298      $seq = 0;
     299    } else {
     300      $seq++;
     301      $sym = "${sym}_$seq";
     302    }
    286303    printf WRKFILE $symfmt, $segaddr, $imp, $sym;
    287304  }
Note: See TracChangeset for help on using the changeset viewer.