-
Notifications
You must be signed in to change notification settings - Fork 478
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
Rust symbol demangling #655
Comments
You don't need to use Anyway I also think it needs to simplify symbol like we do in C++. Following is some of my idea.
But I'm not 100% sure for this. Thoughts? |
Looks better but not sure about it as I'm not familiar with Rust lang as of yet. @quark-zju @ParkHanbum @taeguk Could you give us some thoughts for Rust symbol demangling as above? |
About this idea, there are some problematic things: // except.rs
trait Trait {
fn new() -> Self;
fn foo(&self) {
println!("Trait::foo()");
}
fn bar(&self);
}
struct Struct {
var1: i32,
var2: bool
}
impl Struct {
fn method(&self) {
println!("Struct::method()");
}
}
impl Trait for Struct {
fn new() -> Struct {
println!("Struct::new()");
Struct { var1: 3, var2: true }
}
fn bar(&self) {
println!("Struct::bar()");
}
}
fn main() {
let s: Struct = Trait::new(); // Struct::new()
s.foo(); // Trait::foo()
s.bar(); // Struct::bar()
s.method(); // Struct::method()
}
If applying @namhyung's suggestion to |
I'm not an expert in this area. But the current Rust symbols are kind of Rust implementation details. See rust-lang/rfcs#2603. Things might change rapidly. I think it makes sense to not spend too much effort on things to be changed, and wait for the new, more standardized schema. |
Hi @taeguk @quark-zju, thanks very much for your feedback. It seems to be more complicated than we thought. It'd be better to take time what to do after v0.9.2 release. Thanks a lot for your help! |
@taeguk do you think @quark-zju I don't know when it's finished but I think we still need to support older versions anyway. I agree that it should not spend too much effort but I'd like to make it more readable with a slight simplification if possible.. |
There is rust-demangle that could be used for a more accurate demangling. |
@lu-zero thanks for the comment. We have two demangler - 'simple' demangler shows more compact, readable name while 'full' demangler shows accurate name. I'm talking about the simple demangler here how we can improve readability. Based on the observation above, I think it'd be better using |
Please notice that mangling rules will change soon |
Current output is like below. And #1626 was filed for the new mangling scheme.
|
Looks good! I'd avoid adding the |
Yeah, now it shows |
I've found some symbols from Rust that are not human friendly. Please see.
The demangling output looks as follows:
They might look okay but just uploaded if there's any chance to improve.
The text was updated successfully, but these errors were encountered: