From 04fdec0bbf41cc252ecf6b7a98f58196dc940bc2 Mon Sep 17 00:00:00 2001 From: Christopher Ferris Date: Fri, 11 Aug 2017 15:17:46 -0700 Subject: [PATCH] Add demangling of function name. Bug: 23762183 Test: Builds, unit tests pass. Change-Id: Id49248a27d822db0f3837bfc0c20d004c55315fc --- libbacktrace/UnwindStack.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/libbacktrace/UnwindStack.cpp b/libbacktrace/UnwindStack.cpp index 83a5bb666..e79bca314 100644 --- a/libbacktrace/UnwindStack.cpp +++ b/libbacktrace/UnwindStack.cpp @@ -29,6 +29,7 @@ #endif #include +#include #include #include #include @@ -110,7 +111,9 @@ static bool Unwind(pid_t pid, unwindstack::Memory* memory, unwindstack::Regs* re frame->map.name = map_info->name; uint64_t func_offset = 0; - if (!elf->GetFunctionName(adjusted_rel_pc, &frame->func_name, &func_offset)) { + if (elf->GetFunctionName(adjusted_rel_pc, &frame->func_name, &func_offset)) { + frame->func_name = demangle(frame->func_name.c_str()); + } else { frame->func_name = ""; } frame->func_offset = func_offset;