mirror of
https://github.com/varun-r-mallya/sysprof.git
synced 2025-12-31 20:36:25 +00:00
This doesn't add support for the legacy symbol mangling scheme which is currently the default pending support in tools for the v0 symbol mangling scheme. The legacy symbol mangling scheme is similar enough to C++'s symbol mangling scheme that demangling them using the C++ demangler generally produces readable symbols. The v0 scheme is entirely custom and due to backreferences and encoding all generic arguments not very readable when mangled, so supporting it is more important than supporting the legacy scheme.
30 lines
648 B
C
30 lines
648 B
C
/*
|
|
Imported from https://github.com/LykenSol/rust-demangle.c commit eed29f57732ddb2be434ec89f8ede9b695e5e157
|
|
Modifications from upstream:
|
|
* Add sysprof_ prefix to exported symbols and mark them as hidden
|
|
* Add pragma once
|
|
* Use glib begin/end decls
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
#include <glib.h>
|
|
|
|
G_BEGIN_DECLS
|
|
|
|
#include <stdbool.h>
|
|
#include <stddef.h>
|
|
|
|
#define RUST_DEMANGLE_FLAG_VERBOSE 1
|
|
|
|
G_GNUC_INTERNAL
|
|
bool sysprof_rust_demangle_with_callback(
|
|
const char *mangled, int flags,
|
|
void (*callback)(const char *data, size_t len, void *opaque), void *opaque
|
|
);
|
|
|
|
G_GNUC_INTERNAL
|
|
char *sysprof_rust_demangle(const char *mangled, int flags);
|
|
|
|
G_END_DECLS
|