diff options
author | Steve Block <steveblock@google.com> | 2010-04-27 16:31:00 +0100 |
---|---|---|
committer | Steve Block <steveblock@google.com> | 2010-05-11 14:42:12 +0100 |
commit | dcc8cf2e65d1aa555cce12431a16547e66b469ee (patch) | |
tree | 92a8d65cd5383bca9749f5327fb5e440563926e6 /WebKitTools/Scripts/check-for-global-initializers | |
parent | ccac38a6b48843126402088a309597e682f40fe6 (diff) | |
download | external_webkit-dcc8cf2e65d1aa555cce12431a16547e66b469ee.zip external_webkit-dcc8cf2e65d1aa555cce12431a16547e66b469ee.tar.gz external_webkit-dcc8cf2e65d1aa555cce12431a16547e66b469ee.tar.bz2 |
Merge webkit.org at r58033 : Initial merge by git
Change-Id: If006c38561af287c50cd578d251629b51e4d8cd1
Diffstat (limited to 'WebKitTools/Scripts/check-for-global-initializers')
-rwxr-xr-x | WebKitTools/Scripts/check-for-global-initializers | 24 |
1 files changed, 22 insertions, 2 deletions
diff --git a/WebKitTools/Scripts/check-for-global-initializers b/WebKitTools/Scripts/check-for-global-initializers index cf83048..0472901 100755 --- a/WebKitTools/Scripts/check-for-global-initializers +++ b/WebKitTools/Scripts/check-for-global-initializers @@ -37,6 +37,7 @@ use strict; use File::Basename; sub touch($); +sub demangle($); my $arch = $ENV{'CURRENT_ARCH'}; my $configuration = $ENV{'CONFIGURATION'}; @@ -78,9 +79,14 @@ for my $file (sort @files) { next; } my $sawGlobal = 0; + my @globals; while (<NM>) { if (/^STDOUT:/) { - $sawGlobal = 1 if /__GLOBAL__I/; + my $line = $_; + if ($line =~ /__GLOBAL__I(.+)$/) { + $sawGlobal = 1; + push(@globals, demangle($1)); + } } else { print STDERR if $_ ne "nm: no name list\n"; } @@ -119,7 +125,7 @@ for my $file (sort @files) { } } - print "ERROR: $shortName has a global initializer in it! ($file)\n"; + print "ERROR: $shortName has one or more global initializers in it! ($file), near @globals\n"; $sawError = 1; } } @@ -138,3 +144,17 @@ sub touch($) open(TOUCH, ">", $path) or die "$!"; close(TOUCH); } + +sub demangle($) +{ + my ($symbol) = @_; + if (!open FILT, "c++filt $symbol |") { + print "ERROR: Could not open c++filt\n"; + return; + } + my $result = <FILT>; + close FILT; + chomp $result; + return $result; +} + |