libBacktraceOffline: try both .debug_frame and .ARM.exidx on arm.
Currently, libBacktraceOffline doesn't try .ARM.exidx if a function
appears in .debug_frame. This make it can't unwind through functions
appear in both .debug_frame and .ARM.exidx, but having dwarf instructions
not accepted by libunwind.
This patch fixes this by trying first .debug_frame then .ARM.exidx on arm.
Bug: http://b/69383534
Test: run libbacktrace_test on arm.
Change-Id: Ib95dd56d5cc123a20948e880b51b28ddc04b4a6e
diff --git a/libbacktrace/BacktraceOffline.cpp b/libbacktrace/BacktraceOffline.cpp
index 3041492..641f712 100644
--- a/libbacktrace/BacktraceOffline.cpp
+++ b/libbacktrace/BacktraceOffline.cpp
@@ -222,6 +222,7 @@
} else {
num_ignore_frames--;
}
+ is_debug_frame_used_ = false;
ret = unw_step(&cursor);
} while (ret > 0 && num_frames < MAX_BACKTRACE_FRAMES);
@@ -318,7 +319,8 @@
}
}
}
- if (debug_frame->has_debug_frame || debug_frame->has_gnu_debugdata) {
+ if (!is_debug_frame_used_ && (debug_frame->has_debug_frame || debug_frame->has_gnu_debugdata)) {
+ is_debug_frame_used_ = true;
unw_dyn_info_t di;
unw_word_t segbase = map.start - debug_frame->min_vaddr;
// TODO: http://b/32916571