demumble: Failed to demangle complex function name created from heavily templated lambda function

Hi Nico,

I just tried your demangle tool and it works really great. Unfortunately, it seems it cannot demangle this crazy complex name. As you seem to also work on LLVM’s lib/Demangle maybe you are also interested in such failed demangle reports.

_ZNSt3__116__variant_detail12__visitation6__base12__dispatcherIJLm3EEE10__dispatchIONS1_9__variant15__value_visitorIZNK6libint20TransprecisionMatrixINS8_8TypeListIJsilEEENS_16integer_sequenceImJLm8ELm16ELm32EEEEE11readElementEmmEUlTyRT_E_EEJRKNS0_6__baseILNS0_6_TraitE1EJNS8_6MatrixILm8EsEENSM_ILm8EiEENSM_ILm8ElEENSM_ILm16EsEENSM_ILm16EiEENSM_ILm16ElEENSM_ILm32EsEENSM_ILm32EiEENSM_ILm32ElEEEEEEEEDcSF_DpT0_

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Comments: 21 (11 by maintainers)

Commits related to this issue

Most upvoted comments

Here is a reproducer for the original test case:

https://godbolt.org/z/AjbJwm

The .cpp file is large as it includes a lot of std includes after preprocessing. The relevant function name after mangling is:

@"_ZZN6libint11visitMatrixINS_8TypeListIJsilEEENSt3__116integer_sequenceImJLm8ELm16ELm32EEEEvLi1ERZ23isl_map_coalesce_libintRNS_20TransprecisionMatrixIS2_S5_EEE3$_0JEEET1_OT3_RNS6_IT_T0_E13MatrixVariantEDpRT4_ENKUlTyRSE_E_clINS_6MatrixILm32ElEEEEDaSM_"

which demumble does not demangle even when passed as argument

$~/Projects/demumble/demumble _ZZN6libint11visitMatrixINS_8TypeListIJsilEEENSt3__116integer_sequenceImJLm8ELm16ELm32EEEEvLi1ERZ23isl_map_coalesce_libintRNS_20TransprecisionMatrixIS2_S5_EEE3$_0JEEET1_OT3_RNS6_IT_T0_E13MatrixVariantEDpRT4_ENKUlTyRSE_E_clINS_6MatrixILm32ElEEEEDaSM_
_ZZN6libint11visitMatrixINS_8TypeListIJsilEEENSt3__116integer_sequenceImJLm8ELm16ELm32EEEEvLi1ERZ23isl_map_coalesce_libintRNS_20TransprecisionMatrixIS2_S5_EEE3

I spent around two hours reducing the test case. I hope that the main offending functions are now at the very end of the file. Let me know if this is sufficient or if I should try to reduce further.

$~/Downloads/demumble '_ZZ3fooiENK3$_0clEi'
foo(int)::$_0::operator()(int) const
$c++filt '_ZZ3fooiENK3$_0clEi'
foo(int)::$_0::operator()(int) const
$echo '_ZZ3fooiENK3$_0clEi' | c++filt 
foo(int)::$_0::operator()(int) const
$echo '_ZZ3fooiENK3$_0clEi' | ~/Downloads/demumble 
_ZZ3fooiENK3$_0clEi

It seems demumble decides for some reason to not demangle the function name if passed via a pipe. AFAIU demumble should try autorecognize and decode function names automatically and have the same behavior than c++filt here. My understanding is that only type names are not demangeld automatically.