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

Unified Diff: snapshot/win/exception_snapshot_win.cc

Issue 1356383002: win: Implement CRASHPAD_SIMULATE_CRASH() (Closed) Base URL: https://chromium.googlesource.com/crashpad/crashpad@master
Patch Set: . Created 5 years, 3 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
Index: snapshot/win/exception_snapshot_win.cc
diff --git a/snapshot/win/exception_snapshot_win.cc b/snapshot/win/exception_snapshot_win.cc
index 731669ad49cd41c58a5d26ae2abdb1cfb6c9b252..d7fb4c3cc2e881398e58570e679d875092a002de 100644
--- a/snapshot/win/exception_snapshot_win.cc
+++ b/snapshot/win/exception_snapshot_win.cc
@@ -134,11 +134,20 @@ bool ExceptionSnapshotWin::InitializeFromExceptionPointers(
LOG(ERROR) << "EXCEPTION_POINTERS read failed";
return false;
}
- if (!exception_pointers.ExceptionRecord) {
- LOG(ERROR) << "null ExceptionRecord";
+
+ if (!process_reader.ReadMemory(
+ static_cast<WinVMAddress>(exception_pointers.ContextRecord),
+ sizeof(*context_record),
+ context_record)) {
+ LOG(ERROR) << "ContextRecord";
return false;
}
+ if (!exception_pointers.ExceptionRecord) {
+ LOG(INFO) << "null ExceptionRecord, not capturing any exception";
Mark Mentovai 2015/09/23 20:00:52 This is fully expected now, I don’t think we need
scottmg 2015/09/24 19:16:52 Done.
+ return true;
+ }
+
ExceptionRecordType first_record;
if (!process_reader.ReadMemory(
static_cast<WinVMAddress>(exception_pointers.ExceptionRecord),
@@ -157,14 +166,6 @@ bool ExceptionSnapshotWin::InitializeFromExceptionPointers(
LOG(WARNING) << "dropping chained ExceptionRecord";
}
- if (!process_reader.ReadMemory(
- static_cast<WinVMAddress>(exception_pointers.ContextRecord),
- sizeof(*context_record),
- context_record)) {
- LOG(ERROR) << "ContextRecord";
- return false;
- }
-
return true;
}

Powered by Google App Engine
This is Rietveld 408576698