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

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 nitpick (end namespace comment) 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..c74a6e2ae44671845b01b329f11c1f5d00fc2cbd 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 {
darin (slow to review) 2013/04/08 18:56:14 nit: the contents of namespaces should not be inde
Mostyn Bramley-Moore 2013/04/08 19:44:08 Done.
+ void DebugBreak() {
+ do {
darin (slow to review) 2013/04/08 18:56:14 nit: The "do { ... } while (0)" wrapper should no
Mostyn Bramley-Moore 2013/04/08 19:44:08 Done.
+ if (!BeingDebugged()) {
+ abort();
+ } else {
+ volatile int go = 0;
+ while (!go) {
+ base::PlatformThread::Sleep(base::TimeDelta::FromMilliseconds(100));
+ }
+ }
+ } while (0);
+ }
+} // 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