blob: 45729485884bd52206c4dbd8d3599ddd0952a55a [file] [log] [blame]
license.botf003cfe2008-08-24 09:55:55 +09001// 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.commit3f4a7322008-07-27 06:49:38 +09004
deanm@google.comc2b652a2008-08-13 20:15:11 +09005// 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.commit3f4a7322008-07-27 06:49:38 +090011
12class 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.comc2b652a2008-08-13 20:15:11 +090021
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.commit3f4a7322008-07-27 06:49:38 +090027};
28
deanm@google.comc2b652a2008-08-13 20:15:11 +090029#endif // BASE_DEBUG_UTIL_H_
license.botf003cfe2008-08-24 09:55:55 +090030