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

Unified Diff: snapshot/win/process_reader_win.h

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/memory_snapshot_win.cc ('k') | snapshot/win/process_reader_win.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: snapshot/win/process_reader_win.h
diff --git a/snapshot/win/process_reader_win.h b/snapshot/win/process_reader_win.h
index ff687885b5483ec2126d451481ca867928c4e4f1..0e9ada528284787fa7a51721cad0c66fe20b54e1 100644
--- a/snapshot/win/process_reader_win.h
+++ b/snapshot/win/process_reader_win.h
@@ -18,6 +18,8 @@
#include <sys/time.h>
#include <windows.h>
+#include <vector>
+
#include "util/misc/initialization_state_dcheck.h"
#include "util/win/address_types.h"
#include "util/win/process_info.h"
@@ -27,6 +29,20 @@ namespace crashpad {
//! \brief Accesses information about another process, identified by a HANDLE.
class ProcessReaderWin {
public:
+ //! \brief Contains information about a thread that belongs to a process.
+ struct Thread {
+ Thread();
+ ~Thread() {}
+
+ uint64_t id;
+ WinVMAddress teb;
+ WinVMAddress stack_region_address;
+ WinVMSize stack_region_size;
+ uint32_t suspend_count;
+ uint32_t priority_class;
+ uint32_t priority;
+ };
+
ProcessReaderWin();
~ProcessReaderWin();
@@ -66,6 +82,10 @@ class ProcessReaderWin {
//! \return `true` on success, `false` on failure, with a warning logged.
bool CPUTimes(timeval* user_time, timeval* system_time) const;
+ //! \return The threads that are in the process. The first element (at index
+ //! `0`) corresponds to the main thread.
+ const std::vector<Thread>& Threads();
+
//! \return The modules loaded in the process. The first element (at index
//! `0`) corresponds to the main executable.
const std::vector<ProcessInfo::Module>& Modules();
@@ -73,7 +93,9 @@ class ProcessReaderWin {
private:
HANDLE process_;
ProcessInfo process_info_;
+ std::vector<Thread> threads_;
std::vector<ProcessInfo::Module> modules_;
+ bool initialized_threads_;
InitializationStateDcheck initialized_;
DISALLOW_COPY_AND_ASSIGN(ProcessReaderWin);
« no previous file with comments | « snapshot/win/memory_snapshot_win.cc ('k') | snapshot/win/process_reader_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698