Chromium Code Reviews| Index: base/debug/stack_trace.h |
| diff --git a/base/debug/stack_trace.h b/base/debug/stack_trace.h |
| index ab1d2ebe6a3c00244b5d09cb1e4fcadce16ab093..e98ffecbe081516652c7354ea8ac85e60a7f4889 100644 |
| --- a/base/debug/stack_trace.h |
| +++ b/base/debug/stack_trace.h |
| @@ -23,23 +23,14 @@ struct _EXCEPTION_POINTERS; |
| struct _CONTEXT; |
| #endif |
| -// TODO(699863): Clean up HAVE_TRACE_STACK_FRAME_POINTERS. |
| -#if defined(OS_POSIX) |
| - |
| -#if defined(__i386__) || defined(__x86_64__) |
| -#define HAVE_TRACE_STACK_FRAME_POINTERS 1 |
| -#elif defined(__arm__) && !defined(__thumb__) |
| -#define HAVE_TRACE_STACK_FRAME_POINTERS 1 |
| -#else // defined(__arm__) && !defined(__thumb__) |
| -#define HAVE_TRACE_STACK_FRAME_POINTERS 0 |
| -#endif // defined(__arm__) && !defined(__thumb__) |
| - |
| -#elif defined(OS_WIN) |
| -#define HAVE_TRACE_STACK_FRAME_POINTERS 1 |
| - |
| -#else // defined(OS_WIN) |
| -#define HAVE_TRACE_STACK_FRAME_POINTERS 0 |
| -#endif // defined(OS_WIN) |
| +// Unwinding using frame pointers requires stack traces to have frame pointers |
| +// by default. This still doesn't work on thumb architectures, due to an llvm |
| +// bug. https://bugs.llvm.org/show_bug.cgi?id=18505#c5 |
| +#if ENABLED_FRAME_POINTERS && !(defined(__arm__) && defined(__thumb__)) |
|
Mark Mentovai
2017/03/30 23:43:29
Don’t you need to #include something to get ENABLE
erikchen
2017/04/03 06:33:39
yup
|
| +#define CAN_UNWIND_WITH_FRAME_POINTERS 1 |
| +#else |
| +#define CAN_UNWIND_WITH_FRAME_POINTERS 0 |
| +#endif |
| namespace base { |
| namespace debug { |
| @@ -56,7 +47,7 @@ namespace debug { |
| BASE_EXPORT bool EnableInProcessStackDumping(); |
| // Returns end of the stack, or 0 if we couldn't get it. |
| -#if HAVE_TRACE_STACK_FRAME_POINTERS |
| +#if CAN_UNWIND_WITH_FRAME_POINTERS |
| BASE_EXPORT uintptr_t GetStackEnd(); |
| #endif |
| @@ -119,7 +110,7 @@ class BASE_EXPORT StackTrace { |
| size_t count_; |
| }; |
| -#if HAVE_TRACE_STACK_FRAME_POINTERS |
| +#if CAN_UNWIND_WITH_FRAME_POINTERS |
| // Traces the stack by using frame pointers. This function is faster but less |
| // reliable than StackTrace. It should work for debug and profiling builds, |
| // but not for release builds (although there are some exceptions). |
| @@ -184,7 +175,7 @@ class BASE_EXPORT ScopedStackFrameLinker { |
| }; |
| #endif // !defined(OS_WIN) |
| -#endif // HAVE_TRACE_STACK_FRAME_POINTERS |
| +#endif // CAN_UNWIND_WITH_FRAME_POINTERS |
| namespace internal { |