From f203ee80a527906857f623949e43fe2f65c1c1e8 Mon Sep 17 00:00:00 2001 From: David Chisnall Date: Thu, 29 Sep 2011 16:12:19 +0100 Subject: Added demangler interface to the header. --- src/cxxabi.h | 18 +++++++++++++++++- src/typeinfo.cc | 13 ------------- 2 files changed, 17 insertions(+), 14 deletions(-) diff --git a/src/cxxabi.h b/src/cxxabi.h index 375287c..ce4b442 100644 --- a/src/cxxabi.h +++ b/src/cxxabi.h @@ -180,7 +180,23 @@ void __cxa_increment_exception_refcount(void* thrown_exception); * exception_ptr is deleted. */ void __cxa_decrement_exception_refcount(void* thrown_exception); - +/** + * Demangles a C++ symbol or type name. The buffer, if non-NULL, must be + * allocated with malloc() and must be *n bytes or more long. This function + * may call realloc() on the value pointed to by buf, and will return the + * length of the string via *n. + * + * The value pointed to by status is set to one of the following: + * + * 0: success + * -1: memory allocation failure + * -2: invalid mangled name + * -3: invalid arguments + */ +char* __cxa_demangle(const char* mangled_name, + char* buf, + size_t* n, + int* status); #ifdef __cplusplus } // extern "C" } // namespace diff --git a/src/typeinfo.cc b/src/typeinfo.cc index b0deb8b..fab4015 100644 --- a/src/typeinfo.cc +++ b/src/typeinfo.cc @@ -46,19 +46,6 @@ ABI_NAMESPACE::__pointer_to_member_type_info::~__pointer_to_member_type_info() { // From libelftc extern "C" char *__cxa_demangle_gnu3(const char *); -/** - * Demangles a C++ symbol or type name. The buffer, if non-NULL, must be - * allocated with malloc() and must be *n bytes or more long. This function - * may call realloc() on the value pointed to by buf, and will return the - * length of the string via *n. - * - * The value pointed to by status is set to one of the following: - * - * 0: success - * -1: memory allocation failure - * -2: invalid mangled name - * -3: invalid arguments - */ extern "C" char* __cxa_demangle(const char* mangled_name, char* buf, size_t* n, -- cgit v1.2.3