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
diff --git a/base/logging.cc b/base/logging.cc
index 2648346c..1e20dd0 100644
--- a/base/logging.cc
+++ b/base/logging.cc
@@ -59,6 +59,7 @@
 #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 @@
 
   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 @@
         // 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.
       }
     }
   }