summaryrefslogtreecommitdiffstats
path: root/base/debug/debugger_posix.cc
diff options
context:
space:
mode:
Diffstat (limited to 'base/debug/debugger_posix.cc')
-rw-r--r--base/debug/debugger_posix.cc18
1 files changed, 15 insertions, 3 deletions
diff --git a/base/debug/debugger_posix.cc b/base/debug/debugger_posix.cc
index 2df3c4c..1e0c2ba 100644
--- a/base/debug/debugger_posix.cc
+++ b/base/debug/debugger_posix.cc
@@ -3,13 +3,16 @@
// found in the LICENSE file.
#include "base/debug/debugger.h"
+#include "build/build_config.h"
#include <errno.h>
#include <fcntl.h>
#include <stdio.h>
#include <stdlib.h>
#include <sys/stat.h>
+#if !defined(OS_NACL)
#include <sys/sysctl.h>
+#endif
#include <sys/types.h>
#include <unistd.h>
@@ -125,6 +128,13 @@ bool BeingDebugged() {
return pid_index < status.size() && status[pid_index] != '0';
}
+#elif defined(OS_NACL)
+
+bool BeingDebugged() {
+ NOTIMPLEMENTED();
+ return false;
+}
+
#elif defined(OS_FREEBSD)
bool DebugUtil::BeingDebugged() {
@@ -151,6 +161,11 @@ bool DebugUtil::BeingDebugged() {
#if defined(NDEBUG) && !defined(OS_MACOSX)
#define DEBUG_BREAK() abort()
+#elif defined(OS_NACL)
+// The NaCl verifier doesn't let use use int3. For now, we call abort(). We
+// should ask for advice from some NaCl experts about the optimum thing here.
+// http://code.google.com/p/nativeclient/issues/detail?id=645
+#define DEBUG_BREAK() abort()
#elif defined(ARCH_CPU_ARM_FAMILY)
#define DEBUG_BREAK() asm("bkpt 0")
#else
@@ -159,9 +174,6 @@ bool DebugUtil::BeingDebugged() {
void BreakDebugger() {
DEBUG_BREAK();
-#if defined(NDEBUG)
- _exit(1);
-#endif
}
} // namespace debug