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

Unified Diff: snapshot/win/exception_snapshot_win.cc

Issue 1533183002: win: Capture some memory pointed at by context (Closed) Base URL: https://chromium.googlesource.com/crashpad/crashpad@master
Patch Set: mac Created 4 years, 11 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 | « snapshot/win/exception_snapshot_win.h ('k') | snapshot/win/thread_snapshot_win.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: snapshot/win/exception_snapshot_win.cc
diff --git a/snapshot/win/exception_snapshot_win.cc b/snapshot/win/exception_snapshot_win.cc
index 07b1c8eaae1d139fdca8ce6add3db8100242ef1e..9ec16f69e08cf70b6ecdddd98f6a6318db902bd5 100644
--- a/snapshot/win/exception_snapshot_win.cc
+++ b/snapshot/win/exception_snapshot_win.cc
@@ -14,7 +14,10 @@
#include "snapshot/win/exception_snapshot_win.h"
+#include "snapshot/memory_snapshot.h"
+#include "snapshot/win/capture_context_memory.h"
#include "snapshot/win/cpu_context_win.h"
+#include "snapshot/win/memory_snapshot_win.h"
#include "snapshot/win/process_reader_win.h"
#include "util/win/nt_internals.h"
@@ -41,15 +44,15 @@ bool ExceptionSnapshotWin::Initialize(ProcessReaderWin* process_reader,
WinVMAddress exception_pointers_address) {
INITIALIZATION_STATE_SET_INITIALIZING(initialized_);
- bool found_thread = false;
+ const ProcessReaderWin::Thread* thread = nullptr;
for (const auto& loop_thread : process_reader->Threads()) {
if (thread_id == loop_thread.id) {
- found_thread = true;
+ thread = &loop_thread;
break;
}
}
- if (!found_thread) {
+ if (!thread) {
LOG(ERROR) << "thread ID " << thread_id << " not found in process";
return false;
} else {
@@ -86,6 +89,9 @@ bool ExceptionSnapshotWin::Initialize(ProcessReaderWin* process_reader,
InitializeX86Context(context_record, context_.x86);
}
+ CaptureMemoryPointedToByContext(
+ context_, process_reader, *thread, &extra_memory_);
+
INITIALIZATION_STATE_SET_VALID(initialized_);
return true;
}
@@ -120,6 +126,15 @@ const std::vector<uint64_t>& ExceptionSnapshotWin::Codes() const {
return codes_;
}
+std::vector<const MemorySnapshot*> ExceptionSnapshotWin::ExtraMemory() const {
+ INITIALIZATION_STATE_DCHECK_VALID(initialized_);
+ std::vector<const MemorySnapshot*> result;
+ result.reserve(extra_memory_.size());
+ for (const auto& em : extra_memory_)
+ result.push_back(em);
+ return result;
+}
+
template <class ExceptionRecordType,
class ExceptionPointersType,
class ContextType>
« no previous file with comments | « snapshot/win/exception_snapshot_win.h ('k') | snapshot/win/thread_snapshot_win.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698