backward-cpp icon indicating copy to clipboard operation
backward-cpp copied to clipboard

Feature request: Public API for demangler

Open arthurp opened this issue 3 years ago • 1 comments

It would be useful to provide a public API for demangler::demangle. It can demangle typeid names, so it would be handy for debugging and logging even without a stack trace. And it's already portable unlike directly using other demangling APIs.

Ideally the API would be a simple function: std::string backward::demangle(const char *name) (with the returned std::string owning it's char buffer). However that may not work due to memory management issues. So just providing a public name for demangler so that users could construct one would be fine.

arthurp avatar Dec 04 '20 19:12 arthurp

For what it's worth, Boost already provides a portable demangling utility in Boost.Core - https://www.boost.org/doc/libs/1_75_0/libs/core/doc/html/core/demangle.html

ArekPiekarz avatar Jan 24 '21 17:01 ArekPiekarz