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

Unified Diff: snapshot/win/thread_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/thread_snapshot_win.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: snapshot/win/thread_snapshot_win.cc
diff --git a/snapshot/win/thread_snapshot_win.cc b/snapshot/win/thread_snapshot_win.cc
index 9c8c9ea69861d58e949d7267a778e311a3f6cda0..f3446e9825825bd313b67670bf5a22582705e77c 100644
--- a/snapshot/win/thread_snapshot_win.cc
+++ b/snapshot/win/thread_snapshot_win.cc
@@ -17,6 +17,7 @@
#include <vector>
#include "base/logging.h"
+#include "snapshot/win/capture_context_memory.h"
#include "snapshot/win/cpu_context_win.h"
#include "snapshot/win/process_reader_win.h"
@@ -75,6 +76,9 @@ bool ThreadSnapshotWin::Initialize(
InitializeX86Context(process_reader_thread.context.native, context_.x86);
#endif // ARCH_CPU_X86_64
+ CaptureMemoryPointedToByContext(
+ context_, process_reader, thread_, &pointed_to_memory_);
+
INITIALIZATION_STATE_SET_VALID(initialized_);
return true;
}
@@ -111,9 +115,13 @@ uint64_t ThreadSnapshotWin::ThreadSpecificDataAddress() const {
std::vector<const MemorySnapshot*> ThreadSnapshotWin::ExtraMemory() const {
INITIALIZATION_STATE_DCHECK_VALID(initialized_);
- // TODO(scottmg): Ensure this region is readable, and make sure we don't
- // discard the entire dump if it isn't. https://crashpad.chromium.org/bug/59
- return std::vector<const MemorySnapshot*>(1, &teb_);
+ std::vector<const MemorySnapshot*> result;
+ result.reserve(1 + pointed_to_memory_.size());
+ result.push_back(&teb_);
+ std::copy(pointed_to_memory_.begin(),
+ pointed_to_memory_.end(),
+ std::back_inserter(result));
+ return result;
}
} // namespace internal
« no previous file with comments | « snapshot/win/thread_snapshot_win.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698