14 releases

0.2.12 Aug 10, 2018
0.2.9 May 14, 2018
0.2.7 Nov 27, 2017
0.2.4 May 30, 2017
0.1.0 Dec 11, 2016

#33 in Debugging

Download history 108/week @ 2018-05-19 208/week @ 2018-05-26 223/week @ 2018-06-02 55/week @ 2018-06-09 67/week @ 2018-06-16 153/week @ 2018-06-23 183/week @ 2018-06-30 96/week @ 2018-07-07 135/week @ 2018-07-14 121/week @ 2018-07-21 172/week @ 2018-07-28 197/week @ 2018-08-04 214/week @ 2018-08-11

643 downloads per month
Used in 13 crates (5 directly)

Apache-2.0/MIT

411KB
9K SLoC


lib.rs:

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 Display, 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. Formatting the value with the format! macro or the std::string::ToString::to_string trait method yields the string space::foo(int, int), which is more meaningful to the C++ developer.

Dependencies

~787KB

  • build build.rs
  • build glob 0.2.11
  • dev clap 2.27
  • dev diff 0.1.10