+2011-02-03 Adam Roben <aroben@apple.com>
+
+ Include the crashing function in the link to a crash log
+
+ Fixes <http://webkit.org/b/53739> Crash log links in results.html should include the
+ function that crashed
+
+ Reviewed by David Kilzer.
+
+ * Scripts/old-run-webkit-tests:
+ (crashLocation): Added. Returns the location of the crash.
+ (linksForErrorTest): Include the crash location in the link text for the crash log, if one
+ could be determined.
+
2011-02-03 Dirk Pranke <dpranke@chromium.org>
Unreviewed, build fix.
return \@links;
}
+sub crashLocation($)
+{
+ my ($base) = @_;
+
+ return unless isCygwin();
+
+ my $crashLogFile = File::Spec->catfile($testResultsDirectory, "$base-$crashLogTag.txt");
+
+ # We're looking for the following text:
+ #
+ # FOLLOWUP_IP:
+ # module!function+offset [file:line]
+ #
+ # The second contains the function that crashed (or the function that ended up jumping to a bad
+ # address, as in the case of a null function pointer).
+
+ open LOG, "<", $crashLogFile or return;
+ while (my $line = <LOG>) {
+ last if $line =~ /^FOLLOWUP_IP:/;
+ }
+ my $desiredLine = <LOG>;
+ close LOG;
+
+ return unless $desiredLine;
+
+ # Just take everything up to the first space (which is where the file/line information should
+ # start).
+ $desiredLine =~ /^(\S+)/;
+ return $1;
+}
+
sub linksForErrorTest
{
my ($test) = @_;
my $base = stripExtension($test);
+ my $crashLogText = "crash log";
+ if (my $crashLocation = crashLocation($base)) {
+ $crashLogText .= " (<code>" . $crashLocation . "</code>)";
+ }
+
push @links, @{linksForExpectedAndActualResults($base)};
push @links, { href => "$base-$errorTag.txt", text => "stderr" };
- push @links, { href => "$base-$crashLogTag.txt", text => "crash log" };
+ push @links, { href => "$base-$crashLogTag.txt", text => $crashLogText };
return \@links;
}