From 82d89abc03ea6fd6b9258f0e57be0290b33d7eb1 Mon Sep 17 00:00:00 2001 From: "rch@chromium.org" Date: Fri, 28 Feb 2014 18:25:34 +0000 Subject: Honor the log_assert_handler when running under the debugger. BUG=347287 Review URL: https://codereview.chromium.org/177293007 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@254171 0039d316-1c4b-4281-b951-d872f2087c98 --- base/logging.cc | 27 +++++++++++---------------- 1 file changed, 11 insertions(+), 16 deletions(-) (limited to 'base/logging.cc') diff --git a/base/logging.cc b/base/logging.cc index c4366d8..46b3823 100644 --- a/base/logging.cc +++ b/base/logging.cc @@ -653,25 +653,20 @@ LogMessage::~LogMessage() { str_newline.copy(str_stack, arraysize(str_stack)); base::debug::Alias(str_stack); - // display a message or break into the debugger on a fatal error - if (base::debug::BeingDebugged()) { - base::debug::BreakDebugger(); + if (log_assert_handler) { + // Make a copy of the string for the handler out of paranoia. + log_assert_handler(std::string(stream_.str())); } else { - if (log_assert_handler) { - // make a copy of the string for the handler out of paranoia - log_assert_handler(std::string(stream_.str())); - } else { - // Don't use the string with the newline, get a fresh version to send to - // the debug message process. We also don't display assertions to the - // user in release mode. The enduser can't do anything with this - // information, and displaying message boxes when the application is - // hosed can cause additional problems. + // Don't use the string with the newline, get a fresh version to send to + // the debug message process. We also don't display assertions to the + // user in release mode. The enduser can't do anything with this + // information, and displaying message boxes when the application is + // hosed can cause additional problems. #ifndef NDEBUG - DisplayDebugMessageInDialog(stream_.str()); + DisplayDebugMessageInDialog(stream_.str()); #endif - // Crash the process to generate a dump. - base::debug::BreakDebugger(); - } + // Crash the process to generate a dump. + base::debug::BreakDebugger(); } } else if (severity_ == LOG_ERROR_REPORT) { // We are here only if the user runs with --enable-dcheck in release mode. -- cgit v1.1