license.bot | f003cfe | 2008-08-24 09:55:55 +0900 | [diff] [blame^] | 1 | // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. |
| 2 | // Use of this source code is governed by a BSD-style license that can be |
| 3 | // found in the LICENSE file. |
initial.commit | 3f4a732 | 2008-07-27 06:49:38 +0900 | [diff] [blame] | 4 | |
deanm@google.com | c2b652a | 2008-08-13 20:15:11 +0900 | [diff] [blame] | 5 | // This is a cross platform interface for helper functions related to debuggers. |
| 6 | // You should use this to test if you're running under a debugger, and if you |
| 7 | // would like to yield (breakpoint) into the debugger. |
| 8 | |
| 9 | #ifndef BASE_DEBUG_UTIL_H_ |
| 10 | #define BASE_DEBUG_UTIL_H_ |
initial.commit | 3f4a732 | 2008-07-27 06:49:38 +0900 | [diff] [blame] | 11 | |
| 12 | class DebugUtil { |
| 13 | public: |
| 14 | // Starts the registered system-wide JIT debugger to attach it to specified |
| 15 | // process. |
| 16 | static bool SpawnDebuggerOnProcess(unsigned process_id); |
| 17 | |
| 18 | // Waits wait_seconds seconds for a debugger to attach to the current process. |
| 19 | // When silent is false, an exception is thrown when a debugger is detected. |
| 20 | static bool WaitForDebugger(int wait_seconds, bool silent); |
deanm@google.com | c2b652a | 2008-08-13 20:15:11 +0900 | [diff] [blame] | 21 | |
| 22 | // Are we running under a debugger? |
| 23 | static bool BeingDebugged(); |
| 24 | |
| 25 | // Break into the debugger, assumes a debugger is present. |
| 26 | static void BreakDebugger(); |
initial.commit | 3f4a732 | 2008-07-27 06:49:38 +0900 | [diff] [blame] | 27 | }; |
| 28 | |
deanm@google.com | c2b652a | 2008-08-13 20:15:11 +0900 | [diff] [blame] | 29 | #endif // BASE_DEBUG_UTIL_H_ |
license.bot | f003cfe | 2008-08-24 09:55:55 +0900 | [diff] [blame^] | 30 | |