From: aroben@apple.com Date: Fri, 4 Feb 2011 01:17:57 +0000 (+0000) Subject: Include the crashing function in the link to a crash log X-Git-Url: https://git.webkit.org/?p=WebKit.git;a=commitdiff_plain;h=d9fee306ed7d1c3f9bc037ed3bd7f25b4be86ec3 Include the crashing function in the link to a crash log Fixes 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. git-svn-id: http://svn.webkit.org/repository/webkit/trunk@77571 268f45cc-cd09-0410-ab3c-d52691b4dbfc --- diff --git a/Tools/ChangeLog b/Tools/ChangeLog index a205f2e8372a..e50297904074 100644 --- a/Tools/ChangeLog +++ b/Tools/ChangeLog @@ -1,3 +1,17 @@ +2011-02-03 Adam Roben + + Include the crashing function in the link to a crash log + + Fixes 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 Unreviewed, build fix. diff --git a/Tools/Scripts/old-run-webkit-tests b/Tools/Scripts/old-run-webkit-tests index 80dcc634fdad..7b245306027e 100755 --- a/Tools/Scripts/old-run-webkit-tests +++ b/Tools/Scripts/old-run-webkit-tests @@ -1949,6 +1949,37 @@ sub linksForMismatchTest 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 = ) { + last if $line =~ /^FOLLOWUP_IP:/; + } + my $desiredLine = ; + 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) = @_; @@ -1957,9 +1988,14 @@ sub linksForErrorTest my $base = stripExtension($test); + my $crashLogText = "crash log"; + if (my $crashLocation = crashLocation($base)) { + $crashLogText .= " (" . $crashLocation . ")"; + } + 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; }