Hello all. we use Rust to write component for iOS/macOS/Android and Windows. As the image shows that it's hard to read mangled symbols from Apple's Instruments which collects performance data even if built with debug = true. What's the side effect of marking all the methods to #[no_mangle] even though they will not be exported as FFI? Like this:
AFAIK (I haven't tested it) you can't have multiple methods named new. I would not recommend to mark them all with no_mangle, but instead use the c++ name mangeling (or https://crates.io/crates/rustfilt as a pendant to c++filt).
Your Profiler should have an option available.
After a second look, most of the names are demangled, but the hash in the end which rust uses vor versioning afaik. Can you use rustfilt instead? Is that possible in your program?
Thank you! Never heard about it before. Will try it ASAP. However even without no_mangle Rust forbidden function name overloading. Therefore there's no way to share the same name among methods inside a struct or mod in current version of Rust.
Edit: I think it's still inconvenient for Instruments of Apple after reading the docs of rustfilt. Because rustfilt is an offline tool rather than telling rustc to build things as if there is no namespace or module just like C symbols.
I have written some code seconds ago like you did and got the same error. Sorry for misunderstanding. Since no_mangle isn't a suitable solution. The question will be how to tell rustc not to add those ..$.. symbols or how to use rustfilt to demangle symbols for generated .dSYMs file or .so with debug info automatically.