diff --git a/tests/badsymbols.pl b/tests/badsymbols.pl index 8ce536d0477276..bad037975d9a5a 100755 --- a/tests/badsymbols.pl +++ b/tests/badsymbols.pl @@ -45,6 +45,14 @@ $Cpreprocessor = 'cpp'; } +my $verbose=0; + +# verbose mode when -v is the first argument +if($ARGV[0] eq "-v") { + $verbose=1; + shift; +} + # we may get the dir root pointed out my $root=$ARGV[0] || "."; @@ -53,7 +61,6 @@ my $incdir = "$root/include/curl"; -my $verbose=0; my $summary=0; my $misses=0; @@ -67,6 +74,7 @@ sub scanenums { open H_IN, "-|", "$Cpreprocessor $i$file" || die "Cannot preprocess $file"; while ( ) { + my ($line, $linenum) = ($_, $.); if( /^#(line|) (\d+) \"(.*)\"/) { # if the included file isn't in our incdir, then we skip this section # until next #line @@ -90,6 +98,11 @@ sub scanenums { ($_ ne "typedef") && ($_ ne "enum") && ($_ !~ /^[ \t]*$/)) { + if($verbose) { + print "Source: $Cpreprocessor $i$file\n"; + print "Symbol: $_\n"; + print "Line #$linenum: $line\n\n"; + } push @syms, $_; } } @@ -102,7 +115,13 @@ sub scanheader { scanenums($f); open H, "<$f"; while() { + my ($line, $linenum) = ($_, $.); if (/^#define +([^ \n]*)/) { + if($verbose) { + print "Source: $f\n"; + print "Symbol: $1\n"; + print "Line #$linenum: $line\n\n"; + } push @syms, $1; } }