Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "base/debug/debugger.h" | 5 #include "base/debug/debugger.h" |
| 6 #include "build/build_config.h" | 6 #include "build/build_config.h" |
| 7 | 7 |
| 8 #include <errno.h> | 8 #include <errno.h> |
| 9 #include <execinfo.h> | 9 #include <execinfo.h> |
| 10 #include <fcntl.h> | 10 #include <fcntl.h> |
| 11 #include <stdio.h> | 11 #include <stdio.h> |
| 12 #include <stdlib.h> | 12 #include <stdlib.h> |
| 13 #include <sys/param.h> | 13 #include <sys/param.h> |
| 14 #include <sys/stat.h> | 14 #include <sys/stat.h> |
| 15 #if !defined(OS_NACL) | 15 #if defined(OS_OPENBSD) || defined(OS_FREEBSD) |
|
Evan Martin
2011/06/24 17:51:18
Can you pull these platform-specific includes belo
| |
| 16 #include <sys/sysctl.h> | 16 #include <sys/sysctl.h> |
| 17 #endif | 17 #endif |
| 18 #include <sys/types.h> | 18 #include <sys/types.h> |
| 19 #include <unistd.h> | 19 #include <unistd.h> |
| 20 | 20 |
| 21 #include <string> | 21 #include <string> |
| 22 #include <vector> | 22 #include <vector> |
| 23 | 23 |
| 24 #if defined(__GLIBCXX__) | 24 #if defined(__GLIBCXX__) |
| 25 #include <cxxabi.h> | 25 #include <cxxabi.h> |
| (...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 129 return pid_index < status.size() && status[pid_index] != '0'; | 129 return pid_index < status.size() && status[pid_index] != '0'; |
| 130 } | 130 } |
| 131 | 131 |
| 132 #elif defined(OS_NACL) | 132 #elif defined(OS_NACL) |
| 133 | 133 |
| 134 bool BeingDebugged() { | 134 bool BeingDebugged() { |
| 135 NOTIMPLEMENTED(); | 135 NOTIMPLEMENTED(); |
| 136 return false; | 136 return false; |
| 137 } | 137 } |
| 138 | 138 |
| 139 #elif defined(OS_FREEBSD) | 139 #else |
| 140 | 140 |
| 141 bool BeingDebugged() { | 141 bool BeingDebugged() { |
| 142 // TODO(benl): can we determine this under FreeBSD? | 142 // TODO(benl): can we determine this under FreeBSD? |
| 143 NOTIMPLEMENTED(); | 143 NOTIMPLEMENTED(); |
| 144 return false; | 144 return false; |
| 145 } | 145 } |
| 146 | 146 |
| 147 #endif // defined(OS_FREEBSD) | 147 #endif // defined(OS_FREEBSD) |
| 148 | 148 |
| 149 // We want to break into the debugger in Debug mode, and cause a crash dump in | 149 // We want to break into the debugger in Debug mode, and cause a crash dump in |
| (...skipping 25 matching lines...) Expand all Loading... | |
| 175 | 175 |
| 176 void BreakDebugger() { | 176 void BreakDebugger() { |
| 177 DEBUG_BREAK(); | 177 DEBUG_BREAK(); |
| 178 #if defined(NDEBUG) | 178 #if defined(NDEBUG) |
| 179 _exit(1); | 179 _exit(1); |
| 180 #endif | 180 #endif |
| 181 } | 181 } |
| 182 | 182 |
| 183 } // namespace debug | 183 } // namespace debug |
| 184 } // namespace base | 184 } // namespace base |
| OLD | NEW |