+2011-02-04 Adam Roben <aroben@apple.com>
+
+ Include the crashing function in the link to a crash log on Mac
+
+ Fixes <http://webkit.org/b/53780> Crash log links in results.html should include the
+ function that crashed on Mac
+
+ Reviewed by David Kilzer.
+
+ * Scripts/old-run-webkit-tests:
+ (crashLocation): Moved all the Windows code inside an if instead of using an early return,
+ but didn't otherwise change it. Added an if for Mac that parses the crashing function out of
+ the crash log.
+
2011-02-04 Adam Roben <aroben@apple.com>
Link to Mac crash logs from results.html
{
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).
+ if (isCygwin()) {
+ # 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;
- open LOG, "<", $crashLogFile or return;
- while (my $line = <LOG>) {
- last if $line =~ /^FOLLOWUP_IP:/;
+ # Just take everything up to the first space (which is where the file/line information should
+ # start).
+ $desiredLine =~ /^(\S+)/;
+ return $1;
}
- 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;
+ if (isAppleMacWebKit()) {
+ # We're looking for the following text:
+ #
+ # Thread M Crashed:
+ # N module address function + offset (file:line)
+ #
+ # Some lines might have a module of "???" if we've jumped to a bad address. We should skip
+ # past those.
+
+ open LOG, "<", $crashLogFile or return;
+ while (my $line = <LOG>) {
+ last if $line =~ /^Thread \d+ Crashed:/;
+ }
+ my $location;
+ while (my $line = <LOG>) {
+ $line =~ /^\d+\s+(\S+)\s+\S+ (.* \+ \d+)/ or next;
+ my $module = $1;
+ my $functionAndOffset = $2;
+ next if $module eq "???";
+ $location = "$module: $functionAndOffset";
+ last;
+ }
+ close LOG;
+ return $location;
+ }
}
sub linksForErrorTest