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

Unified Diff: snapshot/win/exception_snapshot_win.cc

Issue 1336823002: win x86: Grab bag of restructuring to get tests working on x86-on-x86 (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 a32c929487a51548521d9b505b8f32ff27bd7671..000c3e240d3d1efa9abdf4aa86c758cb32502a7d 100644
--- a/snapshot/win/exception_snapshot_win.cc
+++ b/snapshot/win/exception_snapshot_win.cc
@@ -69,6 +69,7 @@ bool ExceptionSnapshotWin::Initialize(ProcessReaderWin* process_reader,
return false;
}
+#if defined(ARCH_CPU_64_BITS)
if (process_reader->Is64Bit()) {
EXCEPTION_RECORD64 first_record;
if (!process_reader->ReadMemory(
@@ -105,6 +106,39 @@ bool ExceptionSnapshotWin::Initialize(ProcessReaderWin* process_reader,
CHECK(false) << "TODO(scottmg) x86";
return false;
}
+#else
+ EXCEPTION_RECORD32 first_record;
Mark Mentovai 2015/09/16 02:57:19 This is so similar to what’s above that it’s kind
scottmg 2015/09/16 18:05:06 Done.
+ if (!process_reader->ReadMemory(
+ reinterpret_cast<WinVMAddress>(exception_pointers.ExceptionRecord),
+ sizeof(first_record),
+ &first_record)) {
+ LOG(ERROR) << "ExceptionRecord";
+ return false;
+ }
+ exception_code_ = first_record.ExceptionCode;
+ exception_flags_ = first_record.ExceptionFlags;
+ exception_address_ = first_record.ExceptionAddress;
+ for (DWORD i = 0; i < first_record.NumberParameters; ++i)
+ codes_.push_back(first_record.ExceptionInformation[i]);
+ if (first_record.ExceptionRecord) {
+ // https://code.google.com/p/crashpad/issues/detail?id=43
+ LOG(WARNING) << "dropping chained ExceptionRecord";
+ }
+
+ context_.architecture = kCPUArchitectureX86;
+ context_.x86 = &context_union_.x86;
+ // We assume 64-on-64 here in that we're relying on the CONTEXT definition
Mark Mentovai 2015/09/16 02:57:19 Well, the comment shouldn’t have been copied and p
scottmg 2015/09/16 18:05:06 Oops, I noticed that too, but forgot to upload the
+ // to be the x64 one.
+ CONTEXT context_record;
+ if (!process_reader->ReadMemory(
+ reinterpret_cast<WinVMAddress>(exception_pointers.ContextRecord),
+ sizeof(context_record),
+ &context_record)) {
+ LOG(ERROR) << "ContextRecord";
+ return false;
+ }
+ InitializeX86Context(context_record, context_.x86);
+#endif // ARCH_CPU_64_BITS
INITIALIZATION_STATE_SET_VALID(initialized_);
return true;

Powered by Google App Engine
This is Rietveld 408576698