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

Demangle invocation block symbols #197

Merged
merged 1 commit into from
May 7, 2020

Conversation

jan-auer
Copy link
Contributor

@jan-auer jan-auer commented Apr 28, 2020

Demangles symbols like this one:

___ZN19URLConnectionClient33_clientInterface_cancelConnectionEP16dispatch_queue_sU13block_pointerFvvE_block_invoke14
  • Starts with ___Z (three _)
  • Ends with _block_invoke and an optional number (required if followed by _)
  • Cannot contain clone suffixes

See http://lists.llvm.org/pipermail/cfe-commits/Week-of-Mon-20130408/077728.html

@jan-auer
Copy link
Contributor Author

jan-auer commented Apr 28, 2020

I wonder if we should also support four underscores in parity with __Z to allow for symbols with an additional _ from symbol tables.

@Saldivarcher
Copy link
Collaborator

This looks good so far, I don't see why we couldn't add support for 4 _ if they're out in the wild. So I say add it. 😸

@jan-auer
Copy link
Contributor Author

jan-auer commented May 4, 2020

Added and rebased!

// Taken from https://git.llvm.org/klaus/libcxxabi/commit/5dd173b3792e868a7ebfa699d156f24075eafc01.diff
demangles!(
___ZN19URLConnectionClient33_clientInterface_cancelConnectionEP16dispatch_queue_sU13block_pointerFvvE_block_invoke14,
"invocation function for block in URLConnectionClient::_clientInterface_cancelConnection(dispatch_queue_s*, void () block_pointer)"
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe

Suggested change
"invocation function for block in URLConnectionClient::_clientInterface_cancelConnection(dispatch_queue_s*, void () block_pointer)"
"invocation function for block 14 in URLConnectionClient::_clientInterface_cancelConnection(dispatch_queue_s*, void () block_pointer)"

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just confirming -- LLVM demangles without that number. Do you still prefer me to add it in?

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you still prefer me to add it in?

I guess not.

@Saldivarcher
Copy link
Collaborator

I think this is fine to merge, thanks @jan-auer! 😄

@Saldivarcher Saldivarcher merged commit 1ad5008 into gimli-rs:master May 7, 2020
@jan-auer jan-auer deleted the block-invoke branch May 7, 2020 07:10
@jan-auer
Copy link
Contributor Author

@miguelsaldivar could we get another release with the recent fixes so that we can release this in dependent crates?

@Saldivarcher
Copy link
Collaborator

I think @fitzgen or @khuey are the only ones that can update the crate, maybe one of them can update it this weekend if they find the time :)

@khuey
Copy link
Collaborator

khuey commented May 14, 2020

0.2.16 released.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants