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

Unified Diff: snapshot/win/process_snapshot_win.h

Issue 1392093003: win: Capture some CRITICAL_SECTION debugging data (Closed) Base URL: https://chromium.googlesource.com/crashpad/crashpad@master
Patch Set: . Created 5 years, 2 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_test.cc ('k') | snapshot/win/process_snapshot_win.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: snapshot/win/process_snapshot_win.h
diff --git a/snapshot/win/process_snapshot_win.h b/snapshot/win/process_snapshot_win.h
index a38ac5e9382b2cf16e9ba5295df2c2534d7f6e08..c9edfac3e94d598963a4a1fff4dc260b249833be 100644
--- a/snapshot/win/process_snapshot_win.h
+++ b/snapshot/win/process_snapshot_win.h
@@ -59,12 +59,18 @@ class ProcessSnapshotWin final : public ProcessSnapshot {
//! \param[in] process The handle to create a snapshot from.
//! \param[in] suspension_state Whether \a process has been suspended by the
//! caller.
+ //! \param[in] debug_critical_section_address The address in the target
+ //! process's address space of a `CRITICAL_SECTION` allocated with valid
+ //! `.DebugInfo`. Used as a starting point to walk the process's locks.
+ //! May be `0`.
//!
//! \return `true` if the snapshot could be created, `false` otherwise with
//! an appropriate message logged.
//!
//! \sa ScopedProcessSuspend
- bool Initialize(HANDLE process, ProcessSuspensionState suspension_state);
+ bool Initialize(HANDLE process,
+ ProcessSuspensionState suspension_state,
+ WinVMAddress debug_critical_section_address);
//! \brief Initializes the object's exception.
//!
@@ -138,9 +144,10 @@ class ProcessSnapshotWin final : public ProcessSnapshot {
// Initializes modules_ on behalf of Initialize().
void InitializeModules();
- // Initializes peb_memory_ on behalf of Initialize().
+ // Initializes various memory blocks reachable from the PEB on behalf of
+ // Initialize().
template <class Traits>
- void InitializePebData();
+ void InitializePebData(WinVMAddress debug_critical_section_address);
void AddMemorySnapshot(WinVMAddress address,
WinVMSize size,
@@ -160,8 +167,16 @@ class ProcessSnapshotWin final : public ProcessSnapshot {
WinVMSize DetermineSizeOfEnvironmentBlock(
WinVMAddress start_of_environment_block);
+ // Starting from the address of a CRITICAL_SECTION, walks the doubly-linked
+ // list stored in RTL_CRITICAL_SECTION.DebugInfo.ProcessLocksList adding both
+ // the RTL_CRITICAL_SECTION and the RTL_CRITICAL_SECTION_DEBUG memory blocks
+ // to the snapshot.
+ template <class Traits>
+ void ReadLocks(WinVMAddress start,
+ PointerVector<internal::MemorySnapshotWin>* into);
+
internal::SystemSnapshotWin system_;
- PointerVector<internal::MemorySnapshotWin> peb_memory_;
+ PointerVector<internal::MemorySnapshotWin> extra_memory_;
PointerVector<internal::ThreadSnapshotWin> threads_;
PointerVector<internal::ModuleSnapshotWin> modules_;
scoped_ptr<internal::ExceptionSnapshotWin> exception_;
« no previous file with comments | « snapshot/win/exception_snapshot_win_test.cc ('k') | snapshot/win/process_snapshot_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698