summaryrefslogtreecommitdiffstats
path: root/libbacktrace/include/backtrace/Backtrace.h
diff options
context:
space:
mode:
authorChristopher Ferris <cferris@google.com>2018-03-23 12:51:43 -0700
committerChristopher Ferris <cferris@google.com>2018-03-23 13:01:44 -0700
commit458f4e725d65e0d400552fbdbefb7d4b19d3c3c5 (patch)
tree3215275566d5b1f796c087f834ad044592419f7e /libbacktrace/include/backtrace/Backtrace.h
parent7102f7c98d2aaa393cc6ddc44cf277c5b9b71bf1 (diff)
downloadsystem_core-458f4e725d65e0d400552fbdbefb7d4b19d3c3c5.tar.gz
system_core-458f4e725d65e0d400552fbdbefb7d4b19d3c3c5.tar.bz2
system_core-458f4e725d65e0d400552fbdbefb7d4b19d3c3c5.zip
Method to avoid skipping frames for local unwinds.
In cases where there might be a crash in the unwind library itself, we need a method to avoid skipping these frames or we won't be able to see the actual crash. Added unit test for this behavior. Bug: 74121887 Test: Ran unit tests on host and target. Change-Id: I45825020c174016af39dd8ffdc67acb72a24ad4d
Diffstat (limited to 'libbacktrace/include/backtrace/Backtrace.h')
-rw-r--r--libbacktrace/include/backtrace/Backtrace.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/libbacktrace/include/backtrace/Backtrace.h b/libbacktrace/include/backtrace/Backtrace.h
index a0882079e..735a2f36e 100644
--- a/libbacktrace/include/backtrace/Backtrace.h
+++ b/libbacktrace/include/backtrace/Backtrace.h
@@ -204,6 +204,9 @@ class Backtrace {
std::string GetErrorString(BacktraceUnwindError error);
+ // Set whether to skip frames in libbacktrace/libunwindstack when doing a local unwind.
+ void SetSkipFrames(bool skip_frames) { skip_frames_ = skip_frames; }
+
protected:
Backtrace(pid_t pid, pid_t tid, BacktraceMap* map);
@@ -223,6 +226,9 @@ class Backtrace {
std::vector<backtrace_frame_data_t> frames_;
+ // Skip frames in libbacktrace/libunwindstack when doing a local unwind.
+ bool skip_frames_ = true;
+
BacktraceUnwindError error_;
};