1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34
|
#!/usr/bin/perl
# pipe the text output of zmm::Exception::printStackTrace()
# through this script to receive symbolic information about stack trace
# use strict;
my $STRACE_TAG = "_STRACE_";
while(my $line = <STDIN>)
{
if ($line =~ m/^$STRACE_TAG\s*([0-9]+)\s+(\S+)\s+\[(.*)\]\s*$/)
{
my $pos = $1;
my $exe = $2;
my $addr = $3;
if($exe =~ m/^(.*)\(/)
{
$exe = $1;
}
my $com = "addr2line --demangle --basenames --functions --exe $exe $addr";
my $trace = `$com`;
$trace =~ s/\n/ /g;
print "$pos $trace\n";
}
else
{
print `date`;
print $line;
}
}
# addr2line --demangle --basenames --functions --exe mediaserver 0x8057c48
|