diff options
author | abarth@chromium.org <abarth@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-12-01 07:36:54 +0000 |
---|---|---|
committer | abarth@chromium.org <abarth@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-12-01 07:36:54 +0000 |
commit | 651d9c0a384353bece84d89c77c7f153182417d3 (patch) | |
tree | e370d148bb072f08d2475928a4edc3b372f333fa /base/debug | |
parent | bd254b491ec6815e0a2cf7526aab3e71a6edb93b (diff) | |
download | chromium_src-651d9c0a384353bece84d89c77c7f153182417d3.zip chromium_src-651d9c0a384353bece84d89c77c7f153182417d3.tar.gz chromium_src-651d9c0a384353bece84d89c77c7f153182417d3.tar.bz2 |
Help make base compile under NaCl
This file requires a few tweaks to run under Native Client. For example, there
isn't a NaCl API to determine whether the process is being debugged and int3
isn't a valid NaCl instruction.
Original patch by Eric Seidel.
Review URL: http://codereview.chromium.org/5423002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@67827 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base/debug')
-rw-r--r-- | base/debug/debugger_posix.cc | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/base/debug/debugger_posix.cc b/base/debug/debugger_posix.cc index a5ab066..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 |