[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#1108037: linux-perf: perf report --demangle only works on some(?) symbols



On Wed, 2025-07-09 at 19:16 +0200, наб wrote:
> Control: tag -1 - moreinfo
> 
> On Wed, Jul 09, 2025 at 06:15:10PM +0200, Ben Hutchings wrote:
> > What does the actual declaration of this function look like, and what
> > toolchain are you using to compile it?
[...]
> So the full declaration will be something like
>   template<concepts::resizable_byte_buffer = std::vector<unsigned char, Botan::secure_allocator<unsigned char>>>  // except as an instantiation, not a default
>   void Botan::Cipher_Mode::update(std::vector<unsigned char, Botan::secure_allocator<unsigned char>>, unsigned long);
> so llvm-cxxfilt gets it mostly right.
> 
> I don't really see why the concept bit is in there either,
> it feels like it ought to be immaterial?
> 
> > If I delete the "Tk" from the mangled symbol then they all agree it
> > should be demangled to "void
> > Botan::Cipher_Mode::update<std::vector<unsigned char,
> > Botan::secure_allocator<unsigned char>>>(std::vector<unsigned char,
> > Botan::secure_allocator<unsigned char>>&, unsigned long)".
> 
> This must mean that's "The koncept" as an extension, then, clearly?
> Maybe this wants to get forwarded to LLVM more-so than anything else.
[...]

You forwarded this to
<https://github.com/llvm/llvm-project/issues/147790> and the response
was that this extension was propsoed in
<https://github.com/itanium-cxx-abi/cxx-abi/issues/24> (opened in
2017!).

- The "Tk" sequence seems to be first mentioned by zygoloid on Mar 31,
2023

- g++ started generating this in 
<https://gcc.gnu.org/git/?p=gcc.git;a=commit;h=c3f281a0c1ca50e4df5049923aa2f5d1c3c39ff6>
(September 2023)

- libiberty imported that change in 
<https://sourceware.org/git/?p=binutils-gdb.git;a=commit;h=e2a26339456487e80344a8c3bd0f10711ff28567>
(January 2024)

So it seems like the GNU tools also use this sequence, but perhaps they
have diverged from LLVM on the precise syntax...

Ben.

-- 
Ben Hutchings
Never attribute to conspiracy what can adequately be explained
by stupidity.

Attachment: signature.asc
Description: This is a digitally signed message part


Reply to: