The new version of breakpad imported in bug 1309172 doesn't demangle rust symbols at all, contrary to before, where it tried to C++ demangle them, which worked for many, although far from all. It however has rust-demangle support as long as it's linked against a copy of the rust-demangle-capi crate from https://github.com/luser/rust-demangle-capi/ This imports the code from the rust-demangle-capi crate but because of some build system complications it's not taken as-is: - it uses rusty-cheddar, which is deprecated, to generate a C header. - rusty-cheddar depends on syntex_syntax, which now fails to build. - rust-demangle-capi has crate-type staticlib, which can't be used as a dependency in a Cargo.toml. For that reason, we can't create a fake crate that depends on it to have it vendored. Overall, it's only a few lines of rust, and the C header can be written manually, so this is what we do here. The created crate is named in a way specific to dump_syms. The build system doesn't know how to figure out what system libraries are required to link rust static libraries, although the rust compiler has /some/ support to get the information, so we handle that manually.
16 lines
248 B
C
16 lines
248 B
C
#ifndef __RUST_DEMANGLE_H__
|
|
#define __RUST_DEMANGLE_H__
|
|
|
|
#ifdef __cplusplus
|
|
extern "C" {
|
|
#endif
|
|
|
|
extern char *rust_demangle(const char *);
|
|
extern void free_rust_demangled_name(char *);
|
|
|
|
#ifdef __cplusplus
|
|
}
|
|
#endif
|
|
|
|
#endif /* __RUST_DEMANGLE_H__ */
|