diff options
author | axis <qt-info@nokia.com> | 2011-04-04 07:52:31 (GMT) |
---|---|---|
committer | axis <qt-info@nokia.com> | 2011-04-04 07:55:03 (GMT) |
commit | 0a330c0479a363bc5ab2e2c036fd938b52f4c92c (patch) | |
tree | b0a86f5129784d9084a22eae7d9580ac9ef09ef4 /bin/elf2e32_qtwrapper.pl | |
parent | f7c7232208a3680a81615bfc697548e9ad7ffa02 (diff) | |
download | Qt-0a330c0479a363bc5ab2e2c036fd938b52f4c92c.zip Qt-0a330c0479a363bc5ab2e2c036fd938b52f4c92c.tar.gz Qt-0a330c0479a363bc5ab2e2c036fd938b52f4c92c.tar.bz2 |
Added debugging output to elf2e32_qtwrapper.
Reviewed-by: Trust me
Diffstat (limited to 'bin/elf2e32_qtwrapper.pl')
-rwxr-xr-x | bin/elf2e32_qtwrapper.pl | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/bin/elf2e32_qtwrapper.pl b/bin/elf2e32_qtwrapper.pl index 6675012..8b8eab9 100755 --- a/bin/elf2e32_qtwrapper.pl +++ b/bin/elf2e32_qtwrapper.pl @@ -81,9 +81,37 @@ my $fixupFile = ""; my $runCount = 0; my $returnCode = 0; +# For debugging. Make it nonzero to give verbose output. +my $debugScript = 1; +my @usedDefFiles; +sub recordDefFile { + return if (!$debugScript); + + my ($msg, $file) = @_; + my $content = "$msg, $file:\n"; + my $defFileFd; + if (!open($defFileFd, "< $file")) { + print("Warning: Could not open $file (for debug analysis)\n"); + return; + } + while (<$defFileFd>) { + $content .= $_; + } + + push(@usedDefFiles, $content); +} +sub printRecordedDefFiles { + return if (!$debugScript); + + foreach (@usedDefFiles) { + print ("$_\n"); + } +} + while (1) { if (++$runCount > 2) { print("Internal error in $0, link succeeded, but exports may be wrong.\n"); + printRecordedDefFiles; last; } @@ -110,6 +138,9 @@ while (1) { } close($elf2e32Pipe); + recordDefFile("Run no $runCount, elf2e32 DEF file input", "$definput[1]"); + recordDefFile("Run no $runCount, elf2e32 DEF file output", "$defoutput[1]"); + if ($errors) { $returnCode = 1; last; |