Use abi::__cxa_demangle declared in cxxabi.h
Bug: http://b/175635923
Test: treehugger
Change-Id: Ia191be0b4861b011640edc703b55c13c88bce300
diff --git a/libc/malloc_debug/backtrace.cpp b/libc/malloc_debug/backtrace.cpp
index 0649571..ecb3a80 100644
--- a/libc/malloc_debug/backtrace.cpp
+++ b/libc/malloc_debug/backtrace.cpp
@@ -26,6 +26,7 @@
* SUCH DAMAGE.
*/
+#include <cxxabi.h>
#include <dlfcn.h>
#include <errno.h>
#include <inttypes.h>
@@ -48,8 +49,6 @@
typedef struct _Unwind_Context __unwind_context;
-extern "C" char* __cxa_demangle(const char*, char*, size_t*, int*);
-
static MapData g_map_data;
static const MapEntry* g_current_code_map = nullptr;
@@ -145,7 +144,7 @@
char buf[1024];
if (symbol != nullptr) {
- char* demangled_name = __cxa_demangle(symbol, nullptr, nullptr, nullptr);
+ char* demangled_name = abi::__cxa_demangle(symbol, nullptr, nullptr, nullptr);
const char* name;
if (demangled_name != nullptr) {
name = demangled_name;