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 double leading underscores on Mac #12

Open
kalyanac opened this issue May 6, 2020 · 3 comments
Open

Handle double leading underscores on Mac #12

kalyanac opened this issue May 6, 2020 · 3 comments

Comments

@kalyanac
Copy link

kalyanac commented May 6, 2020

Filter() cannot handle double leading underscore on Mac OS X.

Here is a sample code and output:

package main

import (
"github.com/ianlancetaylor/demangle"
"fmt"
)


func main(){
	name := "__ZNSt3__111char_traitsIcE11eq_int_typeEii"
	options := []demangle.Option{demangle.NoParams, demangle.NoTemplateParams}
	fmt.Println(demangle.Filter(name, options...))
	fmt.Println(demangle.Filter(name[1:], options...))

}

Output:

$> go run test.go
__ZNSt3__111char_traitsIcE11eq_int_typeEii
std::__1::char_traits::eq_int_type
@minux
Copy link

minux commented May 6, 2020 via email

@kalyanac
Copy link
Author

kalyanac commented May 7, 2020

Yes, stripping it easy but it's fairly straight forward to detect the platform and handle the leading underscore. It makes the use of the package easier and returns the expected results.

@minux
Copy link

minux commented May 7, 2020 via email

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

No branches or pull requests

2 participants