{"id":13995513,"url":"https://github.com/gimli-rs/cpp_demangle","last_synced_at":"2025-05-14T07:11:00.703Z","repository":{"id":14060713,"uuid":"75867141","full_name":"gimli-rs/cpp_demangle","owner":"gimli-rs","description":"A crate for demangling C++ symbols","archived":false,"fork":false,"pushed_at":"2025-01-02T06:13:24.000Z","size":3729,"stargazers_count":305,"open_issues_count":29,"forks_count":36,"subscribers_count":14,"default_branch":"master","last_synced_at":"2025-05-08T00:09:33.359Z","etag":null,"topics":["demangle","itanium","linker-symbol","rust"],"latest_commit_sha":null,"homepage":null,"language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/gimli-rs.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE-APACHE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-12-07T19:07:37.000Z","updated_at":"2025-04-25T16:33:53.000Z","dependencies_parsed_at":"2024-01-20T18:05:20.091Z","dependency_job_id":"f3ea0326-8139-4583-abe5-34cec2803e57","html_url":"https://github.com/gimli-rs/cpp_demangle","commit_stats":{"total_commits":457,"total_committers":28,"mean_commits":"16.321428571428573","dds":"0.39606126914660833","last_synced_commit":"15bbde1af70bdb588382fc38a24997575c7b28c9"},"previous_names":[],"tags_count":30,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gimli-rs%2Fcpp_demangle","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gimli-rs%2Fcpp_demangle/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gimli-rs%2Fcpp_demangle/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gimli-rs%2Fcpp_demangle/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gimli-rs","download_url":"https://codeload.github.com/gimli-rs/cpp_demangle/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254076850,"owners_count":22010611,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["demangle","itanium","linker-symbol","rust"],"created_at":"2024-08-09T14:03:27.354Z","updated_at":"2025-05-14T07:10:55.673Z","avatar_url":"https://github.com/gimli-rs.png","language":"Rust","funding_links":[],"categories":["Rust"],"sub_categories":[],"readme":"# `cpp_demangle`: a C++ linker symbol demangler\n\n[![](https://docs.rs/cpp_demangle/badge.svg)](https://docs.rs/cpp_demangle/) [![](https://img.shields.io/crates/v/cpp_demangle.svg) ![](https://img.shields.io/crates/d/cpp_demangle.svg)](https://crates.io/crates/cpp_demangle) [![Build Status](https://github.com/gimli-rs/cpp_demangle/workflows/ci/badge.svg)](https://github.com/gimli-rs/cpp_demangle/actions)\n\nThis crate can parse a C++ “mangled” linker symbol name into a Rust value\ndescribing what the name refers to: a variable, a function, a virtual table,\netc. The description type implements `Display`, producing human-readable text\ndescribing the mangled name. Debuggers and profilers can use this crate to\nprovide more meaningful output.\n\nC++ requires the compiler to choose names for linker symbols consistently across\ncompilation units, so that two compilation units that have seen the same\ndeclarations can pair up definitions in one unit with references in another.\nAlmost all platforms other than Microsoft Windows follow the\n[Itanium C++ ABI][itanium]'s rules for this.\n\n[itanium]: https://itanium-cxx-abi.github.io/cxx-abi/abi.html#mangling\n\nFor example, suppose a C++ compilation unit has the definition:\n\n    namespace space {\n      int foo(int x, int y) { return x+y; }\n    }\n\nThe Itanium C++ ABI specifies that the linker symbol for that function must be\nnamed `_ZN5space3fooEii`. This crate can parse that name into a Rust value\nrepresenting its structure. Formatting the value with the `format!` macro or the\n`std::string::ToString::to_string` trait method yields the string\n`space::foo(int, int)`, which is more meaningful to the C++ developer.\n\n## Usage\n\nAdd `cpp_demangle` to your crate's `Cargo.toml`:\n\n```toml\n[dependencies]\ncpp_demangle = \"0.4.4\"\n```\n\nAnd then demangle some C++ symbols!\n\n```rust\nextern crate cpp_demangle;\nuse cpp_demangle::Symbol;\nuse std::string::ToString;\n\nlet mangled = b\"_ZN5space3fooEibc\";\n\nlet sym = Symbol::new(\u0026mangled[..])\n    .expect(\"Could not parse mangled symbol!\");\n\nlet demangled = sym.to_string();\nassert_eq!(demangled, \"space::foo(int, bool, char)\");\n```\n\n### `no_std` Support\n\n`cpp_demangle` may be configured for working in `no_std` environments that still\nhave allocation support via the `alloc` crate. This is nightly rust only, at the\nmoment, since the `alloc` crate's collections aren't stabilized.\n\nDisable the \"std\" feature, and enable the \"alloc\" feature:\n\n```toml\n[dependencies]\ncpp_demangle = {\n  version = \"0.4.4\",\n  default-features = false,\n  features = [\"alloc\"]\n}\n```\n\n## Documentation\n\n[Documentation on docs.rs](https://docs.rs/cpp_demangle)\n\nExample programs:\n\n* [A `c++filt` clone.](./examples/cppfilt.rs)\n\n  Install it locally with this command:\n\n  ```\n  cargo install cpp_demangle --example cppfilt\n  ```\n\n## Implementation Status\n\nWork is ongoing. While `cpp_demangle` can parse every mangled symbol in\n`libiberty`'s demangler's test suite (the canonical Itanium C++ symbol demangler\nused by GNU tools such as `c++filt`), it does not format all of them\ncharacter-for-character identically. I'm working on fixing that ;)\n\nDespite that, I believe `cpp_demangle` is fairly robust. I've been\nrunning [AFL][] on `cpp_demangle` overnight and it hasn't found any panics for a\nlong time now (and never found any crashes -- thanks Rust!).\n\n[AFL]: https://github.com/rust-fuzz/afl.rs\n\n## License\n\nLicensed under either of\n\n  * Apache License, Version 2.0 ([`LICENSE-APACHE`](./LICENSE-APACHE) or https://www.apache.org/licenses/LICENSE-2.0)\n  * MIT license ([`LICENSE-MIT`](./LICENSE-MIT) or https://opensource.org/licenses/MIT)\n\nat your option.\n\n## Contribution\n\nSee [CONTRIBUTING.md](./CONTRIBUTING.md) for hacking.\n\nUnless you explicitly state otherwise, any contribution intentionally submitted\nfor inclusion in the work by you, as defined in the Apache-2.0 license, shall be\ndual licensed as above, without any additional terms or conditions.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgimli-rs%2Fcpp_demangle","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgimli-rs%2Fcpp_demangle","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgimli-rs%2Fcpp_demangle/lists"}