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

utils: fix demangle_full to only demangle mangled C++ symbols #1780

Merged
merged 1 commit into from
Jul 30, 2023

Conversation

jyf111
Copy link
Contributor

@jyf111 jyf111 commented Jul 26, 2023

Currently, uftrace demangles all symbols, regardless of whether they are mangled C++ symbols or unmangled C symbols.

But when setting --demangle=full, uftrace calls __cxa_demangle(), which translates unmangled symbols confusingly; e.g., "f" is translated to "float".

To address this, now we only call __cxa_demangle() if a symbol is mangled (starts with "_Z").

Fixed #1778

@honggyukim
Copy link
Collaborator

Thanks for the fix! But please rewrite the commit message so that other readers can understand why this change is made with complete sentences.

Please read other commit messages with git log.

Currently, uftrace demangles all symbols, regardless of whether
they are mangled C++ symbols or unmangled C symbols.

But when setting --demangle=full, uftrace calls __cxa_demangle(),
which translates unmangled symbols confusingly; e.g., "f" is translated to "float".

To address this, now we only call __cxa_demangle() if a symbol is mangled
(starts with "_Z").

Fixed: namhyung#1778

Signed-off-by: Yufeng Jin <[email protected]>
Copy link
Owner

@namhyung namhyung left a comment

Choose a reason for hiding this comment

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

LGTM

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.

--demangle=full (__cxa_demangle) confusedly translates unmangled C symbols, e.g. "f" is translated to "float"
3 participants