summaryrefslogtreecommitdiffstats
path: root/libbacktrace
diff options
context:
space:
mode:
authorChristopher Ferris <cferris@google.com>2017-08-11 15:17:46 -0700
committerChristopher Ferris <cferris@google.com>2017-08-11 15:17:46 -0700
commit04fdec0bbf41cc252ecf6b7a98f58196dc940bc2 (patch)
tree7f0cd355c2ce14d4ce948bbf511e92f974a58a16 /libbacktrace
parent12bd22badf129ac21fe257d2b1c1f6c678719299 (diff)
downloadcore-04fdec0bbf41cc252ecf6b7a98f58196dc940bc2.tar.gz
core-04fdec0bbf41cc252ecf6b7a98f58196dc940bc2.tar.bz2
core-04fdec0bbf41cc252ecf6b7a98f58196dc940bc2.zip
Add demangling of function name.
Bug: 23762183 Test: Builds, unit tests pass. Change-Id: Id49248a27d822db0f3837bfc0c20d004c55315fc
Diffstat (limited to 'libbacktrace')
-rw-r--r--libbacktrace/UnwindStack.cpp5
1 files changed, 4 insertions, 1 deletions
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 <backtrace/Backtrace.h>
+#include <demangle.h>
#include <unwindstack/Elf.h>
#include <unwindstack/MapInfo.h>
#include <unwindstack/Maps.h>
@@ -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;