diff options
author | deanm@google.com <deanm@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-08-13 11:15:11 +0000 |
---|---|---|
committer | deanm@google.com <deanm@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-08-13 11:15:11 +0000 |
commit | 1ffe08c10b4ade6acf92d4a1c2f604200facd410 (patch) | |
tree | cb979005f9ee0db87102b9ef67564fbe654b9e67 /base/logging.cc | |
parent | 21d610fb26b275f489dacbd6c372ddf55323ea55 (diff) | |
download | chromium_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/logging.cc')
-rw-r--r-- | base/logging.cc | 24 |
1 files changed, 7 insertions, 17 deletions
diff --git a/base/logging.cc b/base/logging.cc index 2648346..1e20dd0 100644 --- a/base/logging.cc +++ b/base/logging.cc @@ -59,6 +59,7 @@ typedef pthread_mutex_t* MutexHandle; #include <algorithm> #include "base/base_switches.h" #include "base/command_line.h" +#include "base/debug_util.h" #include "base/lock_impl.h" #include "base/logging.h" #include "base/string_util.h" @@ -473,13 +474,9 @@ LogMessage::~LogMessage() { if (severity_ == LOG_FATAL) { // display a message or break into the debugger on a fatal error -#if defined(OS_WIN) - if (::IsDebuggerPresent()) { - __debugbreak(); - } - else -#endif - { + if (DebugUtil::BeingDebugged()) { + DebugUtil::BreakDebugger(); + } else { if (log_assert_handler) { // make a copy of the string for the handler out of paranoia log_assert_handler(std::string(stream_.str())); @@ -488,16 +485,9 @@ LogMessage::~LogMessage() { // the debug message process DisplayDebugMessage(stream_.str()); // Crash the process to generate a dump. -#if defined(OS_WIN) - __debugbreak(); -#elif defined(OS_POSIX) -#if defined(OS_MACOSX) - // TODO: when we have breakpad support, generate a breakpad dump, but - // until then, do not invoke the Apple crash reporter. - Debugger(); -#endif - exit(-1); -#endif + DebugUtil::BreakDebugger(); + // TODO(mmentovai): when we have breakpad support, generate a breakpad + // dump, but until then, do not invoke the Apple crash reporter. } } } |