aboutsummaryrefslogtreecommitdiff
path: root/malloc
diff options
context:
space:
mode:
Diffstat (limited to 'malloc')
-rw-r--r--malloc/mtrace.pl13
1 files changed, 13 insertions, 0 deletions
diff --git a/malloc/mtrace.pl b/malloc/mtrace.pl
index e3ed577..7e06c99 100644
--- a/malloc/mtrace.pl
+++ b/malloc/mtrace.pl
@@ -125,6 +125,19 @@ sub location {
}
}
$cache{$addr} = $str = $addr;
+ } elsif ($str =~ /^.*[[](0x[^]]*)]$/) {
+ my $addr = $1;
+ return $cache{$addr} if (exists $cache{$addr});
+ if ($binary ne "" && open (ADDR, "addr2line -e $binary $addr|")) {
+ my $line = <ADDR>;
+ chomp $line;
+ close (ADDR);
+ if ($line ne '??:0') {
+ $cache{$addr} = $line;
+ return $cache{$addr};
+ }
+ }
+ $cache{$addr} = $str = $addr;
}
return $str;
}