diff options
author | Christopher Ferris | 2018-02-20 15:58:40 -0600 |
---|---|---|
committer | Christopher Ferris | 2018-02-20 19:10:23 -0600 |
commit | e4b3a6aaa46bfe4b20597d89ba73c90e33da463d (patch) | |
tree | 8f2f942a780b8c30a0b312df71ce008071134e28 /libbacktrace | |
parent | ca26cbc5d389971887227b737489ff6b44e82a8f (diff) | |
download | platform-system-core-e4b3a6aaa46bfe4b20597d89ba73c90e33da463d.tar.gz platform-system-core-e4b3a6aaa46bfe4b20597d89ba73c90e33da463d.tar.xz platform-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, | |||
52 | auto process_memory = stack_map->process_memory(); | 52 | auto process_memory = stack_map->process_memory(); |
53 | unwindstack::Unwinder unwinder(MAX_BACKTRACE_FRAMES + num_ignore_frames, stack_map->stack_maps(), | 53 | unwindstack::Unwinder unwinder(MAX_BACKTRACE_FRAMES + num_ignore_frames, stack_map->stack_maps(), |
54 | regs, stack_map->process_memory()); | 54 | regs, stack_map->process_memory()); |
55 | unwinder.SetResolveNames(stack_map->ResolveNames()); | ||
55 | if (stack_map->GetJitDebug() != nullptr) { | 56 | if (stack_map->GetJitDebug() != nullptr) { |
56 | unwinder.SetJitDebug(stack_map->GetJitDebug(), regs->Arch()); | 57 | unwinder.SetJitDebug(stack_map->GetJitDebug(), regs->Arch()); |
57 | } | 58 | } |
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: | |||
154 | 154 | ||
155 | const std::vector<std::string>& GetSuffixesToIgnore() { return suffixes_to_ignore_; } | 155 | const std::vector<std::string>& GetSuffixesToIgnore() { return suffixes_to_ignore_; } |
156 | 156 | ||
157 | // Disabling the resolving of names results in the function name being | ||
158 | // set to an empty string and the function offset being set to zero | ||
159 | // in the frame data when unwinding. | ||
160 | void SetResolveNames(bool resolve) { resolve_names_ = resolve; } | ||
161 | |||
162 | bool ResolveNames() { return resolve_names_; } | ||
163 | |||
157 | protected: | 164 | protected: |
158 | BacktraceMap(pid_t pid); | 165 | BacktraceMap(pid_t pid); |
159 | 166 | ||
@@ -164,6 +171,7 @@ public: | |||
164 | pid_t pid_; | 171 | pid_t pid_; |
165 | std::deque<backtrace_map_t> maps_; | 172 | std::deque<backtrace_map_t> maps_; |
166 | std::vector<std::string> suffixes_to_ignore_; | 173 | std::vector<std::string> suffixes_to_ignore_; |
174 | bool resolve_names_ = true; | ||
167 | }; | 175 | }; |
168 | 176 | ||
169 | class ScopedBacktraceMapIteratorLock { | 177 | class ScopedBacktraceMapIteratorLock { |