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

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: 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..e67ebe564e480b27450d3082744e6b8f9f9e4b9c 100644
--- a/base/debug/debugger_posix.cc
+++ b/base/debug/debugger_posix.cc
@@ -218,16 +218,21 @@ 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() {
+ do {
+ if (!BeingDebugged()) {
+ abort();
+ } else {
+ volatile int go = 0;
+ while (!go) {
+ base::PlatformThread::Sleep(base::TimeDelta::FromMilliseconds(100));
+ }
+ }
+ } while (0);
+ }
+}
bulach 2013/04/08 14:13:58 nit: } // namespace
Mostyn Bramley-Moore 2013/04/08 14:17:35 Done.
+#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