summaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
authoraxis <qt-info@nokia.com>2011-04-04 09:52:31 +0200
committeraxis <qt-info@nokia.com>2011-04-04 09:55:03 +0200
commit0a330c0479a363bc5ab2e2c036fd938b52f4c92c (patch)
treeb0a86f5129784d9084a22eae7d9580ac9ef09ef4 /bin
parentf7c7232208a3680a81615bfc697548e9ad7ffa02 (diff)
downloadqt4-tools-0a330c0479a363bc5ab2e2c036fd938b52f4c92c.tar.gz
Added debugging output to elf2e32_qtwrapper.
Reviewed-by: Trust me
Diffstat (limited to 'bin')
-rwxr-xr-xbin/elf2e32_qtwrapper.pl31
1 files changed, 31 insertions, 0 deletions
diff --git a/bin/elf2e32_qtwrapper.pl b/bin/elf2e32_qtwrapper.pl
index 6675012678..8b8eab9f65 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;