mozilla / dump_syms

Rewrite of breakpad dump_syms tools in Rust
Apache License 2.0
130 stars 34 forks source link

Experiment with optional mode where sym files contain mangled names #431

Open Gankra opened 2 years ago

Gankra commented 2 years ago

Filing this so I don't forget it. This could significantly improve compression, and actually help downstream code in understanding the "structure" of the names as the mangling includes some metadata that you have to moreso guess at from the demangled version.

Apparently it's as simple as removing all the name.demangle calls in these files:

https://github.com/mozilla/dump_syms/blob/213bd65cacb70520736ab3b0b1e9483c1ce84b9e/src/linux/elf.rs#L119-L151

https://github.com/mozilla/dump_syms/blob/eb4e203dfcf3b8fc8487a642d6df7279920103cb/src/windows/symbol.rs#L573


Rough design sketch:

That's it. All the hard work would be in all the downstream tools checking for INFO MANGLED and embedding/invoking a demangler.

Gankra commented 2 years ago

initial conclusion: v0 mangled names are on average longer than the demangled name -- doing this makes the sym file longer. However this is without inlinees, which are presumably the home of really nasty generic balls.