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

Unified Diff: snapshot/win/process_reader_win.cc

Issue 1364803004: win: Save contents of TEBs allowing !teb and !gle to work in windbg (Closed) Base URL: https://chromium.googlesource.com/crashpad/crashpad@dump-without-crashing
Patch Set: . Created 5 years, 3 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
Index: snapshot/win/process_reader_win.cc
diff --git a/snapshot/win/process_reader_win.cc b/snapshot/win/process_reader_win.cc
index bcdf448326941f20a1f455cb087b429bf4eec04b..084c823410d487eed05a4b80e3d6c4495f8d6dbb 100644
--- a/snapshot/win/process_reader_win.cc
+++ b/snapshot/win/process_reader_win.cc
@@ -176,7 +176,8 @@ bool FillThreadContextAndSuspendCount(HANDLE thread_handle,
ProcessReaderWin::Thread::Thread()
: context(),
id(0),
- teb(0),
+ teb_address(0),
+ teb_size(0),
stack_region_address(0),
stack_region_size(0),
suspend_count(0),
@@ -331,8 +332,9 @@ void ProcessReaderWin::ReadThreadData(bool is_64_reading_32) {
// Read the TIB (Thread Information Block) which is the first element of the
// TEB, for its stack fields.
process_types::NT_TIB<Traits> tib;
- thread.teb = thread_basic_info.TebBaseAddress;
- if (ReadMemory(thread.teb, sizeof(tib), &tib)) {
+ thread.teb_address = thread_basic_info.TebBaseAddress;
+ thread.teb_size = sizeof(process_types::TEB<Traits>);
+ if (ReadMemory(thread.teb_address, sizeof(tib), &tib)) {
WinVMAddress base = 0;
WinVMAddress limit = 0;
// If we're reading a WOW64 process, then the TIB we just retrieved is the
@@ -340,8 +342,10 @@ void ProcessReaderWin::ReadThreadData(bool is_64_reading_32) {
// https://msdn.microsoft.com/en-us/library/dn424783.aspx
if (is_64_reading_32) {
process_types::NT_TIB<process_types::internal::Traits32> tib32;
- thread.teb = tib.Wow64Teb;
- if (ReadMemory(thread.teb, sizeof(tib32), &tib32)) {
+ thread.teb_address = tib.Wow64Teb;
+ thread.teb_size =
+ sizeof(process_types::TEB<process_types::internal::Traits32>);
+ if (ReadMemory(thread.teb_address, sizeof(tib32), &tib32)) {
base = tib32.StackBase;
limit = tib32.StackLimit;
}

Powered by Google App Engine
This is Rietveld 408576698