summaryrefslogtreecommitdiffstats
path: root/base/debug_util.h
diff options
context:
space:
mode:
authordeanm@google.com <deanm@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-08-13 11:15:11 +0000
committerdeanm@google.com <deanm@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-08-13 11:15:11 +0000
commit1ffe08c10b4ade6acf92d4a1c2f604200facd410 (patch)
treecb979005f9ee0db87102b9ef67564fbe654b9e67 /base/debug_util.h
parent21d610fb26b275f489dacbd6c372ddf55323ea55 (diff)
downloadchromium_src-1ffe08c10b4ade6acf92d4a1c2f604200facd410.zip
chromium_src-1ffe08c10b4ade6acf92d4a1c2f604200facd410.tar.gz
chromium_src-1ffe08c10b4ade6acf92d4a1c2f604200facd410.tar.bz2
Make debug_util cross platform, adding BeingDebugged and BreakDebugger. Linux
supported added, and Mac OSX left as a todo for the mac team. git-svn-id: svn://svn.chromium.org/chrome/trunk/src@785 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base/debug_util.h')
-rw-r--r--base/debug_util.h16
1 files changed, 13 insertions, 3 deletions
diff --git a/base/debug_util.h b/base/debug_util.h
index 54381e5..288ea4b 100644
--- a/base/debug_util.h
+++ b/base/debug_util.h
@@ -27,8 +27,12 @@
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-#ifndef BASE_DEBUG_UTIL_H__
-#define BASE_DEBUG_UTIL_H__
+// This is a cross platform interface for helper functions related to debuggers.
+// You should use this to test if you're running under a debugger, and if you
+// would like to yield (breakpoint) into the debugger.
+
+#ifndef BASE_DEBUG_UTIL_H_
+#define BASE_DEBUG_UTIL_H_
class DebugUtil {
public:
@@ -39,6 +43,12 @@ class DebugUtil {
// Waits wait_seconds seconds for a debugger to attach to the current process.
// When silent is false, an exception is thrown when a debugger is detected.
static bool WaitForDebugger(int wait_seconds, bool silent);
+
+ // Are we running under a debugger?
+ static bool BeingDebugged();
+
+ // Break into the debugger, assumes a debugger is present.
+ static void BreakDebugger();
};
-#endif // BASE_DEBUG_UTIL_H__
+#endif // BASE_DEBUG_UTIL_H_