Closed
Bug 1311498
Opened 8 years ago
Closed 6 years ago
Demangle Rust function names in dump_syms with rust-demangle-capi
Categories
(Toolkit :: Crash Reporting, defect)
Toolkit
Crash Reporting
Tracking
()
RESOLVED
DUPLICATE
of bug 1474871
People
(Reporter: ted, Unassigned)
References
(Blocks 1 open bug)
Details
I was looking at the state of Breakpad symbols for Rust functions in bug 1268328 and I noted that Rust function names come out looking different on Windows vs. Mac/Linux.
Windows:
FUNC 3e820 1ad 0 read<&mut mp4parse::BMFFBox<mp4parse_capi::mp4parse_io>>
Mac/Linux:
FUNC 4055d00 269 0 {{inlined-root}}::read<mp4parse::BMFFBox<mp4parse::BMFFBox<mp4parse_capi::mp4parse_io>>>
To quote myself from that bug:
This is because rustc uses GCC-style C++ name mangling, and dump_syms uses `cxx_demangle` if it finds a mangled name, and so we get sort-of-C++-looking symbol names back. We could fix dump_syms to not do this (upstream Breakpad took a patch to handle Swift symbols that way: https://codereview.chromium.org/2147523005/ ) and then do the Rust demangling ourselves in symbolstore.py in order to get function names that match across platforms.
This is probably worth doing in order to get consistent Rust signatures across platforms.
Reporter | ||
Comment 1•8 years ago
|
||
I took a slightly different tack. I wrote a crate to provide a C API around the rustc-demangle crate:
https://github.com/luser/rust-demangle-capi
I landed a change to upstream Breakpad to allow linking against rust-demangle-capi and use it to demangle Rust symbols:
https://chromium.googlesource.com/breakpad/breakpad/+/2ecb2baba829a7ed4fff4bc60edf0c1643dc129c
...so now I have to figure out the mechanics to wire up host Rust crates in our build system so I can build and link that into dump_syms.
Reporter | ||
Updated•8 years ago
|
Summary: Demangle Rust function names in symbolstore.py, not dump_syms → Demangle Rust function names in dump_syms with rust-demangle-capi
Reporter | ||
Comment 3•7 years ago
|
||
It was originally blocked on having support for building host Rust code, but I believe that's all wired up now so we'd just need to import + build the rust-demangle-capi crate I wrote, update our Breakpad snapshot, and set the define that Breakpad uses to enable this code.
Flags: needinfo?(ted)
Reporter | ||
Updated•7 years ago
|
Reporter | ||
Updated•6 years ago
|
Status: NEW → RESOLVED
Closed: 6 years ago
Resolution: --- → DUPLICATE
You need to log in
before you can comment on or make changes to this bug.
Description
•