diff options
author | Christopher Ferris <cferris@google.com> | 2018-02-20 13:58:40 -0800 |
---|---|---|
committer | Christopher Ferris <cferris@google.com> | 2018-02-20 17:10:23 -0800 |
commit | e4b3a6aaa46bfe4b20597d89ba73c90e33da463d (patch) | |
tree | 8f2f942a780b8c30a0b312df71ce008071134e28 /libbacktrace | |
parent | ca26cbc5d389971887227b737489ff6b44e82a8f (diff) | |
download | system_core-e4b3a6aaa46bfe4b20597d89ba73c90e33da463d.tar.gz system_core-e4b3a6aaa46bfe4b20597d89ba73c90e33da463d.tar.bz2 system_core-e4b3a6aaa46bfe4b20597d89ba73c90e33da463d.zip |
Add ability to skip function name resolution.
Bug: 73558129
Test: New unit tests pass.
Change-Id: I3a6b17d2590aacb367ab3e3a51cc85be73ad64eb
Diffstat (limited to 'libbacktrace')
-rw-r--r-- | libbacktrace/UnwindStack.cpp | 1 | ||||
-rw-r--r-- | libbacktrace/include/backtrace/BacktraceMap.h | 8 |
2 files changed, 9 insertions, 0 deletions
diff --git a/libbacktrace/UnwindStack.cpp b/libbacktrace/UnwindStack.cpp index 7e2e6d05e..0e32e4740 100644 --- a/libbacktrace/UnwindStack.cpp +++ b/libbacktrace/UnwindStack.cpp @@ -52,6 +52,7 @@ bool Backtrace::Unwind(unwindstack::Regs* regs, BacktraceMap* back_map, auto process_memory = stack_map->process_memory(); unwindstack::Unwinder unwinder(MAX_BACKTRACE_FRAMES + num_ignore_frames, stack_map->stack_maps(), regs, stack_map->process_memory()); + unwinder.SetResolveNames(stack_map->ResolveNames()); if (stack_map->GetJitDebug() != nullptr) { unwinder.SetJitDebug(stack_map->GetJitDebug(), regs->Arch()); } diff --git a/libbacktrace/include/backtrace/BacktraceMap.h b/libbacktrace/include/backtrace/BacktraceMap.h index 7b26079cc..da544725d 100644 --- a/libbacktrace/include/backtrace/BacktraceMap.h +++ b/libbacktrace/include/backtrace/BacktraceMap.h @@ -154,6 +154,13 @@ public: const std::vector<std::string>& GetSuffixesToIgnore() { return suffixes_to_ignore_; } + // Disabling the resolving of names results in the function name being + // set to an empty string and the function offset being set to zero + // in the frame data when unwinding. + void SetResolveNames(bool resolve) { resolve_names_ = resolve; } + + bool ResolveNames() { return resolve_names_; } + protected: BacktraceMap(pid_t pid); @@ -164,6 +171,7 @@ public: pid_t pid_; std::deque<backtrace_map_t> maps_; std::vector<std::string> suffixes_to_ignore_; + bool resolve_names_ = true; }; class ScopedBacktraceMapIteratorLock { |