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

Unified Diff: base/debug/debugger_posix.cc

Issue 8773051: use os_bsd and OS_BSD and add some OS_FREEBSD conditions (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: style Created 9 years 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 | « base/base.gypi ('k') | base/process_util.h » ('j') | 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 1c7304c47c68be81104d15bff964d394a57761a1..4dee92db8dcfab1596b7a881342b39dd1014a221 100644
--- a/base/debug/debugger_posix.cc
+++ b/base/debug/debugger_posix.cc
@@ -33,6 +33,10 @@
#include <sys/sysctl.h>
#endif
+#if defined(OS_FREEBSD)
+#include <sys/user.h>
+#endif
+
#include <ostream>
#include "base/basictypes.h"
@@ -108,7 +112,9 @@ bool BeingDebugged() {
// This process is being debugged if the P_TRACED flag is set.
is_set = true;
-#if defined(OS_BSD)
+#if defined(OS_FREEBSD)
+ being_debugged = (info.ki_flag & P_TRACED) != 0;
+#elif defined(OS_BSD)
being_debugged = (info.p_flag & P_TRACED) != 0;
#else
being_debugged = (info.kp_proc.p_flag & P_TRACED) != 0;
@@ -152,22 +158,14 @@ bool BeingDebugged() {
return pid_index < status.size() && status[pid_index] != '0';
}
-#elif defined(OS_NACL)
-
-bool BeingDebugged() {
- NOTIMPLEMENTED();
- return false;
-}
-
#else
bool BeingDebugged() {
- // TODO(benl): can we determine this under FreeBSD?
NOTIMPLEMENTED();
return false;
}
-#endif // defined(OS_FREEBSD)
+#endif
// We want to break into the debugger in Debug mode, and cause a crash dump in
// Release mode. Breakpad behaves as follows:
« no previous file with comments | « base/base.gypi ('k') | base/process_util.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698