Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(243)

Unified Diff: handler/win/crash_report_exception_handler.cc

Issue 1405443006: hack to MiniDumpWriteDump from exception handler (Closed) Base URL: https://chromium.googlesource.com/crashpad/crashpad@handles-redux
Patch Set: Created 5 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « handler/handler.gyp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: handler/win/crash_report_exception_handler.cc
diff --git a/handler/win/crash_report_exception_handler.cc b/handler/win/crash_report_exception_handler.cc
index 843ac0f5a9aade7cfde120853f4fadffdb8aa9c1..a8ac655d98c576736cc44eb42f7b704d683037ab 100644
--- a/handler/win/crash_report_exception_handler.cc
+++ b/handler/win/crash_report_exception_handler.cc
@@ -64,6 +64,39 @@ unsigned int CrashReportExceptionHandler::ExceptionHandlerServerException(
const unsigned int termination_code =
process_snapshot.Exception()->Exception();
+ // XXX XXX XXX
+ ScopedFileHandle file(LoggingOpenFileForWrite(
+ base::FilePath(FILE_PATH_LITERAL(
+ "c:\\users\\scott\\desktop\\minidumpwritedump.dmp")),
+ FileWriteMode::kTruncateOrCreate,
+ FilePermissions::kWorldReadable));
+ MINIDUMP_EXCEPTION_INFORMATION minidump_exception_information;
+ ExceptionInformation exception_information;
+ ProcessReaderWin process_reader;
+ if (!process_reader.Initialize(process, ProcessSuspensionState::kSuspended))
+ return false;
+ if (!process_reader.ReadMemory(exception_information_address,
+ sizeof(exception_information),
+ &exception_information)) {
+ LOG(WARNING) << "ReadMemory ExceptionInformation failed";
+ return false;
+ }
+ minidump_exception_information.ThreadId =
+ static_cast<DWORD>(process_snapshot.Exception()->ThreadID());
+ minidump_exception_information.ExceptionPointers =
+ reinterpret_cast<EXCEPTION_POINTERS*>(
+ exception_information.exception_pointers);
+ minidump_exception_information.ClientPointers = true;
+ MiniDumpWriteDump(process,
+ GetProcessId(process),
+ file.get(),
+ static_cast<MINIDUMP_TYPE>(MiniDumpWithFullMemory |
+ MiniDumpWithHandleData),
+ &minidump_exception_information,
+ nullptr,
+ nullptr);
+ // XXX XXX XXX
+
CrashpadInfoClientOptions client_options;
process_snapshot.GetCrashpadOptions(&client_options);
if (client_options.crashpad_handler_behavior != TriState::kDisabled) {
« no previous file with comments | « handler/handler.gyp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698