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

Add demangle support using external rustfilt tool #2

Merged
merged 1 commit into from
Dec 13, 2024

Conversation

chrysn
Copy link
Member

@chrysn chrysn commented Dec 2, 2024

This PR adds support for an external demangler: If rustfilt is present, symbol names are shown in a demangled way. This should cover not only Rust but also C++ symbols.


This is moving haukepetersen#12 in here; marked as a draft as I'll have yet to review whether this is still all current.

@chrysn
Copy link
Member Author

chrysn commented Dec 6, 2024

Rebased and re-tested: Symbols that previously looked like _ZN123_$LT$coap_handler_implementations..wkc_implementation..WellKnownCore$LT$H$GT$$u20$as$u20$coap_handler..handler..Handler$GT$14build_response17hdc5d4b38dfaaba18E now look like <coap_handler_implementations::wkc_implementation::WellKnownCore<H> as coap_handler::handler::Handler>::build_response (which is just as long but at least readable).

This does emit a warning about not having been able to run the demangler even when there are no Rust symbols, but then I don't know how to reliably recognize them, it's just a warning, and it's not like there's certainty that there are no surprise Rust modules in RIOT any more ;-)

Please review.

@chrysn chrysn marked this pull request as ready for review December 6, 2024 15:52
@chrysn chrysn changed the title Add demangle support using external rustfix tool Add demangle support using external rustfilt tool Dec 9, 2024
Copy link

@mguetschow mguetschow left a comment

Choose a reason for hiding this comment

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

Tested locally (or rather with BUILD_IN_DOCKER=1) with examples/rust-gcoap and can confirm this to work nicely.

All rust symbols are grouped under "unspecified", but that was already the case before so out of scope for this PR, I'd say.

Just a minor suggestion below.

Copy link

@mguetschow mguetschow left a comment

Choose a reason for hiding this comment

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

Thanks!

Copy link

@mguetschow mguetschow left a comment

Choose a reason for hiding this comment

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

Oh wait, the commit message should be changed with s/rustfix/rustfilt/

@chrysn
Copy link
Member Author

chrysn commented Dec 13, 2024

Thanks for checking, fixed.

@chrysn chrysn dismissed mguetschow’s stale review December 13, 2024 12:51

Applied the commit message suggestion

@chrysn chrysn merged commit 1bdcea7 into RIOT-OS:master Dec 13, 2024
@chrysn chrysn deleted the demangle branch December 13, 2024 12:52
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.

2 participants