diff options
author | Christopher Ferris <cferris@google.com> | 2017-06-01 14:15:09 -0700 |
---|---|---|
committer | Christopher Ferris <cferris@google.com> | 2017-06-02 10:10:24 -0700 |
commit | 7d0aea91c9b8939ddc5c8602d427da1052441309 (patch) | |
tree | 96036f4ef17c113c5333ba77cfea0eaf90388b46 /libbacktrace | |
parent | 9b537f24bd375cf1954e94efbc8ee7d97b5a1e8e (diff) | |
download | core-7d0aea91c9b8939ddc5c8602d427da1052441309.tar.gz core-7d0aea91c9b8939ddc5c8602d427da1052441309.tar.bz2 core-7d0aea91c9b8939ddc5c8602d427da1052441309.zip |
Use demangle for function names.
Bug: 62141808
Test: Ran unit tests, ran debuggerd -b on android processes.
Change-Id: I40f341bcb2b35dd0a020d245d6b6f2ed2df65481
Diffstat (limited to 'libbacktrace')
-rw-r--r-- | libbacktrace/Android.bp | 1 | ||||
-rw-r--r-- | libbacktrace/Backtrace.cpp | 5 |
2 files changed, 4 insertions, 2 deletions
diff --git a/libbacktrace/Android.bp b/libbacktrace/Android.bp index 7dd9227b3..a643a295c 100644 --- a/libbacktrace/Android.bp +++ b/libbacktrace/Android.bp @@ -113,6 +113,7 @@ cc_library { static_libs: ["libasync_safe", "libcutils"], }, }, + whole_static_libs: ["libdemangle"], } cc_library_shared { diff --git a/libbacktrace/Backtrace.cpp b/libbacktrace/Backtrace.cpp index 3545661ee..e46d35389 100644 --- a/libbacktrace/Backtrace.cpp +++ b/libbacktrace/Backtrace.cpp @@ -27,6 +27,8 @@ #include <backtrace/Backtrace.h> #include <backtrace/BacktraceMap.h> +#include <demangle.h> + #include "BacktraceLog.h" #include "thread_utils.h" #include "UnwindCurrent.h" @@ -62,8 +64,7 @@ std::string Backtrace::GetFunctionName(uintptr_t pc, uintptr_t* offset, const ba if (map->start == 0 || (map->flags & PROT_DEVICE_MAP)) { return ""; } - std::string func_name = GetFunctionNameRaw(pc, offset); - return func_name; + return demangle(GetFunctionNameRaw(pc, offset).c_str()); } bool Backtrace::VerifyReadWordArgs(uintptr_t ptr, word_t* out_value) { |