diff --git a/mozilla/tools/trace-malloc/leak-soup.pl b/mozilla/tools/trace-malloc/leak-soup.pl
index 17db54a0bcd..0a6090c9ccc 100755
--- a/mozilla/tools/trace-malloc/leak-soup.pl
+++ b/mozilla/tools/trace-malloc/leak-soup.pl
@@ -999,6 +999,10 @@ sub addr2line($$) {
# of filehandles that are talking to an addr2line process.
my $fhs = $::Addr2Lines{$dso};
if (! $fhs) {
+ if (!(-r $dso)) {
+ # bogus filename (that happens sometimes), so bail
+ return { 'dso' => $dso, 'addr' => $addr };
+ }
my ($in, $out) = (new FileHandle, new FileHandle);
open2($in, $out, "addr2line --exe=$dso") || die "unable to open addr2line --exe=$dso";
$::Addr2Lines{$dso} = $fhs = { 'in' => $in, 'out' => $out };
@@ -1088,10 +1092,11 @@ sub dump_objects($$$) {
my $result = addr2line($2, $3);
if ($result->{'file'}) {
- if ($result->{'file'} =~ s/.*\/mozilla/http:\/\/lxr.mozilla.org\/mozilla\/source/) {
- # It's mozilla source! Clean up refs to dist/include
- $result->{'file'} =~ s/..\/..\/dist\/include\///;
- print "{'file'}#$result->{'line'}\">$mangled
\n";
+ # It's mozilla source! Clean up refs to dist/include
+ if (($result->{'file'} =~ s/.*\.\.\/\.\.\/dist\/include\//http:\/\/bonsai.mozilla.org\/cvsguess.cgi\?file=/) ||
+ ($result->{'file'} =~ s/.*\/mozilla/http:\/\/bonsai.mozilla.org\/cvsblame.cgi\?file=mozilla/)) {
+ my $prevline = $result->{'line'} - 10;
+ print "{'file'}\&mark=$result->{'line'}#$prevline\">$mangled
\n";
}
else {
print "$mangled ($result->{'file'}, line $result->{'line'})
\n";
@@ -1135,7 +1140,7 @@ print "