summaryrefslogtreecommitdiffstats
path: root/scripts/Dpkg/Shlibs
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/Dpkg/Shlibs')
-rw-r--r--scripts/Dpkg/Shlibs/Cppfilt.pm10
1 files changed, 8 insertions, 2 deletions
diff --git a/scripts/Dpkg/Shlibs/Cppfilt.pm b/scripts/Dpkg/Shlibs/Cppfilt.pm
index 1f054a1..010fe66 100644
--- a/scripts/Dpkg/Shlibs/Cppfilt.pm
+++ b/scripts/Dpkg/Shlibs/Cppfilt.pm
@@ -96,8 +96,14 @@ sub cppfilt_demangle {
my $demangled = readline($filt->{to});
chop $demangled;
- # If the symbol was not demangled, return undef
- $demangled = undef if $symbol eq $demangled;
+ # If the symbol was not demangled, return undef. Otherwise normalize
+ # it as llvm packs ending angle brackets with no intermediate spaces
+ # as allowed by C++11, contrary to GNU binutils.
+ if ($symbol eq $demangled) {
+ $demangled = undef;
+ } else {
+ $demangled =~ s{(?<=>)(?=>)}{ }g;
+ }
# Remember the last result
$filt->{last_symbol} = $symbol;