Index: base/debug/stack_trace.h |
diff --git a/base/debug/stack_trace.h b/base/debug/stack_trace.h |
index 23e7b5164b63472409a92e992c5c1095dfa48d26..44c712f2aa934e1de66eb3e29ce5586a56613a5a 100644 |
--- a/base/debug/stack_trace.h |
+++ b/base/debug/stack_trace.h |
@@ -24,7 +24,17 @@ struct _CONTEXT; |
#if defined(OS_POSIX) && ( \ |
defined(__i386__) || defined(__x86_64__) || \ |
- (defined(__arm__) && !defined(__thumb__))) |
+ (defined(__arm__) && ( \ |
+ /* We don't normally support thumb mode... */ \ |
+ !defined(__thumb__) || \ |
+ /* ...unless we're building non-component build with Clang. \ |
+ Clang properly sets up fp register, so we can walk stack frames, \ |
+ but it pushes arbitrary number of registers between fp (r7) and \ |
+ lr (r14). However in non-component build, where all code is \ |
+ inside a single mapped region, it's possible to guess lr by \ |
+ probing up to 7 locations on the stack. */ \ |
+ (defined(__clang__) && !defined(COMPONENT_BUILD) && \ |
+ defined(OS_ANDROID))))) |
#define HAVE_TRACE_STACK_FRAME_POINTERS 1 |
#else |
#define HAVE_TRACE_STACK_FRAME_POINTERS 0 |