From bbf346a856d4a7c5c2ab0e65d7cccf3dc1f23f13 Mon Sep 17 00:00:00 2001 From: Adam McNeeney Date: Fri, 22 Aug 2014 10:01:24 +0100 Subject: [PATCH] Cope with new addr2line outputs for DWARF4 Copes with ? for line number (converts to 0). Copes with (discriminator ) suffixes to file/linenum (removes). Change-Id: I96207165e4852c71d3512157864f12d101cdf44a --- src/pprof | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/pprof b/src/pprof index 03e5806..ad21f07 100755 --- a/src/pprof +++ b/src/pprof @@ -4768,6 +4768,12 @@ sub MapToSymbols { $filelinenum =~ s|\\|/|g; # turn windows-style paths into unix-style paths + # Remove discriminator markers as this comes after the line number and + # confuses the rest of this script. + $filelinenum =~ s/ \(discriminator \d+\)$//; + # Convert unknown line numbers into line 0. + $filelinenum =~ s/:\?$/:0/; + my $pcstr = $pclist->[$count]; my $function = ShortFunctionName($fullfunction); my $nms = $nm_symbols->{$pcstr};