Fix function shortening for complex cases, like:
std::basic_ostream<A, B>& operator<< <A, B >(std::basic_ostream<A, B>&, T const&)
--- 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<A, B>& operator<< <A, B >(std::basic_ostream<A, B>&, T const&)
+ my ($str, $next, $prefix) = extract_bracketed($text, '<(', qr/([^<\(]*operator[<>]{1,2})?[^<\(]*/);
if($str) {
$short_signature .= $prefix;
$text = $next;
--- 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<A, B>& operator<< <A, B >(std::basic_ostream<A, B>&, 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;