about summary refs log tree commit diff
path: root/malloc/mtrace.pl
diff options
context:
space:
mode:
Diffstat (limited to 'malloc/mtrace.pl')
-rw-r--r--malloc/mtrace.pl13
1 files changed, 13 insertions, 0 deletions
diff --git a/malloc/mtrace.pl b/malloc/mtrace.pl
index e3ed5771dd..7e06c99f29 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;
 }