Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2295)

Unified Diff: base/debug/debugger_posix.cc

Issue 2315403002: Force crash on Mac10.9- in BreakDebugger() (Closed)
Patch Set: - Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | base/debug/stack_trace_posix.cc » ('j') | base/debug/stack_trace_posix.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/debug/debugger_posix.cc
diff --git a/base/debug/debugger_posix.cc b/base/debug/debugger_posix.cc
index e92d5a5619a6f113ad5b7adc5fdb92af7a541b46..e0295fdedb8660285de6c77dd663e9978360c0c5 100644
--- a/base/debug/debugger_posix.cc
+++ b/base/debug/debugger_posix.cc
@@ -26,6 +26,9 @@
#if defined(OS_MACOSX)
#include <AvailabilityMacros.h>
+#if !defined(OS_IOS)
+#include "base/mac/mac_util.h"
+#endif
#endif
#if defined(OS_MACOSX) || defined(OS_BSD)
@@ -231,7 +234,13 @@ void DebugBreak() {
} // namespace
#define DEBUG_BREAK() DebugBreak()
#elif defined(DEBUG_BREAK_ASM)
-#define DEBUG_BREAK() DEBUG_BREAK_ASM()
+#define DEBUG_BREAK() \
+ do { \
+ if (base::mac::IsAtMostOS10_9()) \
+ *static_cast<volatile int*>(0) = 0; \
+ else \
+ DEBUG_BREAK_ASM(); \
+ } while (false)
#else
#error "Don't know how to debug break on this architecture/OS"
#endif
« no previous file with comments | « no previous file | base/debug/stack_trace_posix.cc » ('j') | base/debug/stack_trace_posix.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698