/[dynamips]/upstream/dynamips-0.2.6-RC5/profiler_resolve.pl
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Contents of /upstream/dynamips-0.2.6-RC5/profiler_resolve.pl

Parent Directory Parent Directory | Revision Log Revision Log


Revision 6 - (show annotations)
Sat Oct 6 16:09:07 2007 UTC (16 years, 5 months ago) by dpavlin
File MIME type: text/plain
File size: 579 byte(s)
dynamips-0.2.6-RC5

1 #! /usr/bin/perl -w
2
3 use strict;
4
5 my @files = <*.profile>;
6
7 die "No *.profile files found\n" if !@files;
8
9 for my $file (@files) {
10 print STDERR "processing $file.\n";
11
12 open my ($f), '<', $file or die "open $file: $!";
13 open my ($fnew), '>', "$file.names" or die "create $file.names: $!";
14
15 my ($prog) = $file =~ /^(.*)\.profile\z/ or die;
16 open my ($nm), "nm -n $prog |" or die;
17
18 my %nm;
19 while (<$nm>) {
20 next if /^\s/;
21 /^([0-9a-f]{8}) . (.*)/ or die "bad nm";
22 $nm{$1} = sprintf "%-30s", $2;
23 }
24
25 while (<$f>) {
26 s/^([0-9a-f]{8})/$nm{$1} || $1/e;
27 print $fnew $_;
28 }
29 }

Properties

Name Value
svn:executable *

  ViewVC Help
Powered by ViewVC 1.1.26