Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UnexpectedText error when demangling a symbol with a postfix attribute #156

Closed
koute opened this issue Sep 20, 2018 · 4 comments
Closed

Comments

@koute
Copy link

koute commented Sep 20, 2018

When demangling the symbols of one of our applications the cpp_demangle manages to demangle everything besides symbols like these which generate an Err(UnexpectedText):

let sym = "_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE12_M_constructIPcEEvT_S7_St20forward_iterator_tag.isra.90";
println!( "{:?}", cpp_demangle::Symbol::new( sym ) );

Using c++filt works:

void std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::_M_construct<char*>(char*, char*, std::forward_iterator_tag) [clone .isra.90]

The problem here is the postfix .isra.90 which should result in [clone .isra.90] in the demangled symbol, which isn't supported by cpp_demangle.

I see that the libiberty's test_libiberty_demangle_172 from #16 is similar to this, so this is technically a duplicate, but I guess it might be worthwhile to have separate issues to help prioritize the cases which actually pop up in real production binaries?

@fitzgen
Copy link
Member

fitzgen commented Sep 25, 2018

Thanks for filing an issue, @koute!

@Saldivarcher
Copy link
Collaborator

Seems like clone-suffix is missing, I'll add it. 👍

@Saldivarcher
Copy link
Collaborator

This was fixed with #170, forgot to mention this should be closed!

@fitzgen
Copy link
Member

fitzgen commented Mar 18, 2019

Thanks!

@fitzgen fitzgen closed this as completed Mar 18, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants