|
1 | 1 | use strict;
|
2 | 2 | use warnings;
|
3 | 3 | use 5.8.0;
|
4 |
| -use File::Spec::Functions qw(splitpath catpath); |
5 | 4 | use List::Util qw(max);
|
6 | 5 |
|
7 | 6 | my @def;
|
|
12 | 11 | # src/tools/msvc/gendef.pl
|
13 | 12 | #
|
14 | 13 |
|
15 |
| -sub dumpsyms |
16 |
| -{ |
17 |
| - my ($objfile, $symfile) = @_; |
18 |
| - my ($symvol, $symdirs, $symbase) = splitpath($symfile); |
19 |
| - my $tmpfile = catpath($symvol, $symdirs, "symbols.out"); |
20 |
| - system("dumpbin /symbols /out:$tmpfile $_ >NUL") |
21 |
| - && die "Could not call dumpbin"; |
22 |
| - rename($tmpfile, $symfile); |
23 |
| - return; |
24 |
| -} |
25 |
| - |
26 | 14 | # Given a symbol file path, loops over its contents
|
27 | 15 | # and returns a list of symbols of interest as a dictionary
|
28 | 16 | # of 'symbolname' -> symtype, where symtype is:
|
@@ -177,15 +165,12 @@ sub usage
|
177 | 165 |
|
178 | 166 | my %def = ();
|
179 | 167 |
|
180 |
| -while (<$ARGV[0]/*.obj>) ## no critic (RequireGlobFunction); |
181 |
| -{ |
182 |
| - my $objfile = $_; |
183 |
| - my $symfile = $objfile; |
184 |
| - $symfile =~ s/\.obj$/.sym/i; |
185 |
| - dumpsyms($objfile, $symfile); |
186 |
| - print "."; |
187 |
| - extract_syms($symfile, \%def); |
188 |
| -} |
| 168 | +my $symfile = "$ARGV[0]/all.sym"; |
| 169 | +my $tmpfile = "$ARGV[0]/tmp.sym"; |
| 170 | +system("dumpbin /symbols /out:$tmpfile $ARGV[0]/*.obj >NUL") |
| 171 | + && die "Could not call dumpbin"; |
| 172 | +rename($tmpfile, $symfile); |
| 173 | +extract_syms($symfile, \%def); |
189 | 174 | print "\n";
|
190 | 175 |
|
191 | 176 | writedef($deffile, $platform, \%def);
|
|
0 commit comments