Expand description
This crate can parse a C++ “mangled” linker symbol name into a Rust value
describing what the name refers to: a variable, a function, a virtual table,
etc. The description type implements functions such as demangle(),
producing human-readable text describing the mangled name. Debuggers and
profilers can use this crate to provide more meaningful output.
C++ requires the compiler to choose names for linker symbols consistently across compilation units, so that two compilation units that have seen the same declarations can pair up definitions in one unit with references in another. Almost all platforms other than Microsoft Windows follow the Itanium C++ ABI’s rules for this.
For example, suppose a C++ compilation unit has the definition:
namespace space {
  int foo(int x, int y) { return x+y; }
}The Itanium C++ ABI specifies that the linker symbol for that function must
be named _ZN5space3fooEii. This crate can parse that name into a Rust
value representing its structure. That Rust value can be demangle()d to the
string space::foo(int, int), which is more meaningful to the C++
developer.
Modules§
- ast
- Abstract syntax tree types for mangled symbols.
- error
- Custom ErrorandResulttypes for thecpp_demanglecrate.
Structs§
- DemangleOptions 
- Options to control the demangling process.
- ParseOptions 
- Options to control the parsing process.
- Symbol
- A mangled symbol that has been parsed into an AST.
Enums§
- DemangleNode Type 
- The type of a demangled AST node. This is only partial, not all nodes are represented.
Traits§
- DemangleWrite 
- Sink for demangled text that reports syntactic structure.
Type Aliases§
- BorrowedSymbol 
- A Symbolwhich borrows the underlying storage for the mangled name.
- OwnedSymbol 
- A Symbolwhich owns the underlying storage for the mangled name.