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

Unified Diff: base/debug/debugger_posix.cc

Issue 13597005: Android: improve native debuggability (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix indentation and remove do...while(0) Created 7 years, 8 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 | no next file » | no next file with comments »
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 aef73ec7cbcd2839b892f44b2fed014bfcbd567e..44a8ad6ca6a8ea3afb572c32b6b8c6d3d656a702 100644
--- a/base/debug/debugger_posix.cc
+++ b/base/debug/debugger_posix.cc
@@ -218,16 +218,19 @@ bool BeingDebugged() {
// SIG triggered by native code.
//
// Use GDB to set |go| to 1 to resume execution.
-#define DEBUG_BREAK() do { \
- if (!BeingDebugged()) { \
- abort(); \
- } else { \
- volatile int go = 0; \
- while (!go) { \
- base::PlatformThread::Sleep(base::TimeDelta::FromMilliseconds(100)); \
- } \
- } \
-} while (0)
+namespace {
+void DebugBreak() {
+ if (!BeingDebugged()) {
+ abort();
+ } else {
+ volatile int go = 0;
+ while (!go) {
+ base::PlatformThread::Sleep(base::TimeDelta::FromMilliseconds(100));
+ }
+ }
+}
+} // namespace
+#define DEBUG_BREAK() DebugBreak()
#else
// ARM && !ANDROID
#define DEBUG_BREAK() asm("bkpt 0")
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698