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

handle demangling OSX names with underscore prefix #924

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

alk
Copy link

@alk alk commented Jan 23, 2025

See discussion at #477 (comment)

// OSX has all the symbols prefixed with extra '_' so lets try
// once more without it
if strings.HasPrefix(fn.SystemName, "_") {
if demangled := demangle.Filter(fn.SystemName[1:], o...); demangled != fn.SystemName {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Could we just pass strings.StripPrefix(fn.SystemName, "_"), ... in the demangle.Filter call above?

Copy link
Author

Choose a reason for hiding this comment

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

Above? So just cut all the time no matter OS and everything? Then it won't work, since _ is usually used for mangled names for regular OS-es. And cutting it will simply break everything.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Oh, got it.

Can we add a test that will exercise this code path?

Copy link
Author

Choose a reason for hiding this comment

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

Ack. Added test case.

@alk alk force-pushed the osx-un-underscore branch from 7dd4dbb to 85c67d0 Compare January 24, 2025 01:36
@codecov-commenter
Copy link

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 66.96%. Comparing base (0ed6a68) to head (85c67d0).
Report is 61 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #924      +/-   ##
==========================================
+ Coverage   66.86%   66.96%   +0.09%     
==========================================
  Files          44       44              
  Lines        9824     9864      +40     
==========================================
+ Hits         6569     6605      +36     
- Misses       2794     2820      +26     
+ Partials      461      439      -22     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

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.

3 participants