summaryrefslogtreecommitdiffstats
path: root/chrome/app/breakpad_win.cc
diff options
context:
space:
mode:
authorcdn@chromium.org <cdn@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-09-27 21:18:03 +0000
committercdn@chromium.org <cdn@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-09-27 21:18:03 +0000
commit93893c777a03ab76b24d25acad4d323b971f9d63 (patch)
tree436e135e67794ead7eeed182b453a32ed5963eae /chrome/app/breakpad_win.cc
parentc2f875f7fa31901e66385359ece70b6d211f6620 (diff)
downloadchromium_src-93893c777a03ab76b24d25acad4d323b971f9d63.zip
chromium_src-93893c777a03ab76b24d25acad4d323b971f9d63.tar.gz
chromium_src-93893c777a03ab76b24d25acad4d323b971f9d63.tar.bz2
Add initial framework for detecting and reporting unusual process state at the time of a crash
BUG=128594 TEST=Nothing to test yet, tets will be added with the rest of the code. Review URL: https://chromiumcodereview.appspot.com/10933104 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@159120 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/app/breakpad_win.cc')
-rw-r--r--chrome/app/breakpad_win.cc15
1 files changed, 15 insertions, 0 deletions
diff --git a/chrome/app/breakpad_win.cc b/chrome/app/breakpad_win.cc
index 0ed20f6..c5d07c1 100644
--- a/chrome/app/breakpad_win.cc
+++ b/chrome/app/breakpad_win.cc
@@ -27,6 +27,7 @@
#include "base/win/win_util.h"
#include "breakpad/src/client/windows/handler/exception_handler.h"
#include "chrome/app/breakpad_field_trial_win.h"
+#include "chrome/app/crash_analysis_win.h"
#include "chrome/app/hard_error_handler_win.h"
#include "chrome/common/child_process_logging.h"
#include "chrome/common/chrome_result_codes.h"
@@ -91,6 +92,7 @@ const char kMinUpdateVersion[] = "1.3.21.115";
google_breakpad::ExceptionHandler* g_breakpad = NULL;
google_breakpad::ExceptionHandler* g_dumphandler_no_crash = NULL;
+CrashAnalysis* g_crash_analysis = NULL;
static size_t g_url_chunks_offset = 0;
static size_t g_num_of_extensions_offset = 0;
@@ -156,6 +158,14 @@ InjectDumpForHangDebugging(HANDLE process) {
0, 0, NULL);
}
+extern "C" void DumpProcessAbnormalSignature() {
+ if (!g_breakpad)
+ return;
+ g_custom_entries->push_back(
+ google_breakpad::CustomInfoEntry(L"unusual-crash-signature", L""));
+ g_breakpad->WriteMinidump();
+}
+
// Reduces the size of the string |str| to a max of 64 chars. Required because
// breakpad's CustomInfoEntry raises an invalid_parameter error if the string
// we want to set is longer.
@@ -733,6 +743,8 @@ extern "C" int __declspec(dllexport) CrashForException(
EXCEPTION_POINTERS* info) {
if (g_breakpad) {
g_breakpad->WriteMinidumpForException(info);
+ if (g_crash_analysis)
+ g_crash_analysis->Analyze(info);
::TerminateProcess(::GetCurrentProcess(), content::RESULT_CODE_KILLED);
}
return EXCEPTION_CONTINUE_SEARCH;
@@ -928,6 +940,9 @@ void InitCrashReporter() {
google_breakpad::ExceptionHandler::HANDLER_NONE,
dump_type, pipe_name.c_str(), custom_info);
+ if (command.HasSwitch(switches::kPerformCrashAnalysis))
+ g_crash_analysis = new CrashAnalysis();
+
if (g_breakpad->IsOutOfProcess()) {
// Tells breakpad to handle breakpoint and single step exceptions.
// This might break JIT debuggers, but at least it will always