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

Unified Diff: snapshot/win/process_snapshot_win.cc

Issue 1131473005: win: Add thread snapshot and memory snapshot for stacks (Closed) Base URL: https://chromium.googlesource.com/crashpad/crashpad@master
Patch Set: comment Created 5 years, 7 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/process_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/process_snapshot_win.cc
diff --git a/snapshot/win/process_snapshot_win.cc b/snapshot/win/process_snapshot_win.cc
index 16623069ce9015bda8be3437815757000bcdfb00..b25e8caa1079f2267babe3e53543020338af56e2 100644
--- a/snapshot/win/process_snapshot_win.cc
+++ b/snapshot/win/process_snapshot_win.cc
@@ -22,7 +22,7 @@ namespace crashpad {
ProcessSnapshotWin::ProcessSnapshotWin()
: ProcessSnapshot(),
system_(),
- // TODO(scottmg): threads_(),
+ threads_(),
modules_(),
// TODO(scottmg): exception_(),
process_reader_(),
@@ -46,7 +46,7 @@ bool ProcessSnapshotWin::Initialize(HANDLE process) {
system_.Initialize(&process_reader_);
- // TODO(scottmg): InitializeThreads();
+ InitializeThreads();
InitializeModules();
INITIALIZATION_STATE_SET_VALID(initialized_);
@@ -131,8 +131,12 @@ const SystemSnapshot* ProcessSnapshotWin::System() const {
}
std::vector<const ThreadSnapshot*> ProcessSnapshotWin::Threads() const {
- CHECK(false) << "TODO(scottmg)";
- return std::vector<const ThreadSnapshot*>();
+ INITIALIZATION_STATE_DCHECK_VALID(initialized_);
+ std::vector<const ThreadSnapshot*> threads;
+ for (internal::ThreadSnapshotWin* thread : threads_) {
+ threads.push_back(thread);
+ }
+ return threads;
}
std::vector<const ModuleSnapshot*> ProcessSnapshotWin::Modules() const {
@@ -145,10 +149,22 @@ std::vector<const ModuleSnapshot*> ProcessSnapshotWin::Modules() const {
}
const ExceptionSnapshot* ProcessSnapshotWin::Exception() const {
- CHECK(false) << "TODO(scottmg)";
+ CHECK(false) << "TODO(scottmg): Exception()";
return nullptr;
}
+void ProcessSnapshotWin::InitializeThreads() {
+ const std::vector<ProcessReaderWin::Thread>& process_reader_threads =
+ process_reader_.Threads();
+ for (const ProcessReaderWin::Thread& process_reader_thread :
+ process_reader_threads) {
+ auto thread = make_scoped_ptr(new internal::ThreadSnapshotWin());
+ if (thread->Initialize(&process_reader_, process_reader_thread)) {
+ threads_.push_back(thread.release());
+ }
+ }
+}
+
void ProcessSnapshotWin::InitializeModules() {
const std::vector<ProcessInfo::Module>& process_reader_modules =
process_reader_.Modules();
« no previous file with comments | « snapshot/win/process_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