Index: content/app/content_main_runner.cc |
diff --git a/content/app/content_main_runner.cc b/content/app/content_main_runner.cc |
index df069e87e07a6c77125fe6af3f16f93918126926..c45b55373b43a0fe613a52ba2e5d4b7bab727945 100644 |
--- a/content/app/content_main_runner.cc |
+++ b/content/app/content_main_runner.cc |
@@ -10,6 +10,7 @@ |
#include "base/at_exit.h" |
#include "base/command_line.h" |
#include "base/debug/debugger.h" |
+#include "base/debug/stack_trace.h" |
#include "base/files/file_path.h" |
#include "base/i18n/icu_util.h" |
#include "base/lazy_instance.h" |
@@ -195,6 +196,16 @@ void CommonSubprocessInit(const std::string& process_type) { |
// surface UI -- but it's likely they get this wrong too so why not. |
setlocale(LC_NUMERIC, "C"); |
#endif |
+ |
+#if !defined(OFFICIAL_BUILD) |
+ // Print stack traces to stderr when crashes occur. This opens up security |
+ // holes so it should never be enabled for official builds. |
+ base::debug::EnableInProcessStackDumping(); |
+#if defined(OS_WIN) |
+ base::RouteStdioToConsole(false); |
+ LoadLibraryA("dbghelp.dll"); |
brucedawson
2016/04/18 23:07:00
What is the purpose of this LoadLibrary call? The
|
+#endif |
+#endif |
} |
class ContentClientInitializer { |
@@ -603,7 +614,7 @@ class ContentMainRunnerImpl : public ContentMainRunner { |
#if defined(OS_WIN) |
// Route stdio to parent console (if any) or create one. |
if (command_line.HasSwitch(switches::kEnableLogging)) |
- base::RouteStdioToConsole(); |
+ base::RouteStdioToConsole(true); |
#endif |
// Enable startup tracing asap to avoid early TRACE_EVENT calls being |