summaryrefslogtreecommitdiffstats
path: root/base/logging.cc
diff options
context:
space:
mode:
authorapatrick@chromium.org <apatrick@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-04-03 18:45:05 +0000
committerapatrick@chromium.org <apatrick@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-04-03 18:45:05 +0000
commiteb4c4d03a20213f03846c3337b2019da1fd92f15 (patch)
tree02f2c81a1349d08d310948d96b79f6798549d7d1 /base/logging.cc
parent3331c714202f873cdf98d867601741cf15cb6748 (diff)
downloadchromium_src-eb4c4d03a20213f03846c3337b2019da1fd92f15.zip
chromium_src-eb4c4d03a20213f03846c3337b2019da1fd92f15.tar.gz
chromium_src-eb4c4d03a20213f03846c3337b2019da1fd92f15.tar.bz2
Log message is captured on stack prior to generating minidump for fatal errors.
This is to aid in diagnosing minidumps from fatal errors in the field. Review URL: https://chromiumcodereview.appspot.com/9921024 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@130423 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base/logging.cc')
-rw-r--r--base/logging.cc7
1 files changed, 7 insertions, 0 deletions
diff --git a/base/logging.cc b/base/logging.cc
index 8db5740..8d1c8f8 100644
--- a/base/logging.cc
+++ b/base/logging.cc
@@ -46,6 +46,7 @@ typedef pthread_mutex_t* MutexHandle;
#include "base/base_switches.h"
#include "base/command_line.h"
+#include "base/debug/alias.h"
#include "base/debug/debugger.h"
#include "base/debug/stack_trace.h"
#include "base/eintr_wrapper.h"
@@ -636,6 +637,12 @@ LogMessage::~LogMessage() {
}
if (severity_ == LOG_FATAL) {
+ // Ensure the first characters of the string are on the stack so they
+ // are contained in minidumps for diagnostic purposes.
+ char str_stack[1024];
+ 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();