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
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 @@
 
 #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 @@
   }
 
   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();