diff options
author | brettw@google.com <brettw@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-01-01 16:08:52 +0000 |
---|---|---|
committer | brettw@google.com <brettw@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-01-01 16:08:52 +0000 |
commit | d028296ec1c0fdfbd40e2390ca3121de7055295d (patch) | |
tree | da32e476d290074ceaaaaee65659e54a2dae822f /base/debug | |
parent | 1e3d150462ba6d3f9952e2ee976cb26396e3452c (diff) | |
download | chromium_src-d028296ec1c0fdfbd40e2390ca3121de7055295d.zip chromium_src-d028296ec1c0fdfbd40e2390ca3121de7055295d.tar.gz chromium_src-d028296ec1c0fdfbd40e2390ca3121de7055295d.tar.bz2 |
Remove base/debug_util. Move the debug UI related functions to base/debug/debugger.h
Move the OS X specific crash report changing function to base/mac/os_crash_dumps
TEST=it compiles
BUG=none
Review URL: http://codereview.chromium.org/6092005
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@70358 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base/debug')
-rw-r--r-- | base/debug/debugger.cc | 10 | ||||
-rw-r--r-- | base/debug/debugger.h | 8 | ||||
-rw-r--r-- | base/debug/debugger_posix.cc | 2 | ||||
-rw-r--r-- | base/debug/debugger_win.cc | 3 |
4 files changed, 20 insertions, 3 deletions
diff --git a/base/debug/debugger.cc b/base/debug/debugger.cc index fb23524..8674f1f 100644 --- a/base/debug/debugger.cc +++ b/base/debug/debugger.cc @@ -9,6 +9,8 @@ namespace base { namespace debug { +static bool is_debug_ui_suppressed = false; + bool WaitForDebugger(int wait_seconds, bool silent) { for (int i = 0; i < wait_seconds * 10; ++i) { if (BeingDebugged()) { @@ -21,5 +23,13 @@ bool WaitForDebugger(int wait_seconds, bool silent) { return false; } +void SetSuppressDebugUI(bool suppress) { + is_debug_ui_suppressed = suppress; +} + +bool IsDebugUISuppressed() { + return is_debug_ui_suppressed; +} + } // namespace debug } // namespace base diff --git a/base/debug/debugger.h b/base/debug/debugger.h index 008d77d..77bde0d 100644 --- a/base/debug/debugger.h +++ b/base/debug/debugger.h @@ -33,6 +33,14 @@ bool BeingDebugged(); // Break into the debugger, assumes a debugger is present. void BreakDebugger(); +// Used in test code, this controls whether showing dialogs and breaking into +// the debugger is suppressed for debug errors, even in debug mode (normally +// release mode doesn't do this stuff -- this is controlled separately). +// Normally UI is not suppressed. This is normally used when running automated +// tests where we want a crash rather than a dialog or a debugger. +void SetSuppressDebugUI(bool suppress); +bool IsDebugUISuppressed(); + } // namespace debug } // namespace base diff --git a/base/debug/debugger_posix.cc b/base/debug/debugger_posix.cc index ffa4670d..b865e65 100644 --- a/base/debug/debugger_posix.cc +++ b/base/debug/debugger_posix.cc @@ -137,7 +137,7 @@ bool BeingDebugged() { #elif defined(OS_FREEBSD) -bool DebugUtil::BeingDebugged() { +bool BeingDebugged() { // TODO(benl): can we determine this under FreeBSD? NOTIMPLEMENTED(); return false; diff --git a/base/debug/debugger_win.cc b/base/debug/debugger_win.cc index d1d47cd..3323b61 100644 --- a/base/debug/debugger_win.cc +++ b/base/debug/debugger_win.cc @@ -8,7 +8,6 @@ #include <dbghelp.h> #include "base/basictypes.h" -#include "base/debug_util.h" #include "base/logging.h" namespace base { @@ -103,7 +102,7 @@ bool BeingDebugged() { } void BreakDebugger() { - if (DebugUtil::AreDialogsSuppressed()) + if (IsDebugUISuppressed()) _exit(1); __debugbreak(); } |