# HG changeset patch # User Vincent Tondellier # Date 1451501852 -3600 # Node ID 6f091abdf5fbb8c41b3e4d359a444bd1fcb37d2c # Parent d84db31dd51cafa308de19dcf65c59024558436e Fix function shortening for complex cases, like: std::basic_ostream& operator<< (std::basic_ostream&, T const&) diff -r d84db31dd51c -r 6f091abdf5fb lib/CrashTest/Plugin/CrashSignatureExtractor/C_Cpp.pm --- a/lib/CrashTest/Plugin/CrashSignatureExtractor/C_Cpp.pm Tue Dec 29 00:15:38 2015 +0100 +++ b/lib/CrashTest/Plugin/CrashSignatureExtractor/C_Cpp.pm Wed Dec 30 19:57:32 2015 +0100 @@ -58,7 +58,10 @@ my $short_signature = ""; my $text = $signature; do { - my ($str, $next, $prefix) = extract_bracketed($text, '<(', '[^<(]*'); + # the complex prefix is here to match normal function names (the last '[^<\(]*' part) + # but also the complex case of unbalanced <> like in: + # std::basic_ostream& operator<< (std::basic_ostream&, T const&) + my ($str, $next, $prefix) = extract_bracketed($text, '<(', qr/([^<\(]*operator[<>]{1,2})?[^<\(]*/); if($str) { $short_signature .= $prefix; $text = $next; diff -r d84db31dd51c -r 6f091abdf5fb lib/CrashTest/Plugin/StackFilter/HideArgs.pm --- a/lib/CrashTest/Plugin/StackFilter/HideArgs.pm Tue Dec 29 00:15:38 2015 +0100 +++ b/lib/CrashTest/Plugin/StackFilter/HideArgs.pm Wed Dec 30 19:57:32 2015 +0100 @@ -44,7 +44,10 @@ my $short_signature = ""; my $text = $signature; do { - my ($str, $next, $prefix) = extract_bracketed($text, '<(', '[^<(]*'); + # the complex prefix is here to match normal function names (the last '[^<\(]*' part) + # but also the complex case of unbalanced <> like in: + # std::basic_ostream& operator<< (std::basic_ostream&, T const&) + my ($str, $next, $prefix) = extract_bracketed($text, '<(', qr/([^<\(]*operator[<>]{1,2})?[^<\(]*/); if($str) { $short_signature .= $prefix . substr($str, 0, 1) . substr($str, -1, 1); $text = $next;