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

Issue 1364053002: win: Save contents of PEB to minidump (Closed)

Created:
5 years, 3 months ago by scottmg
Modified:
5 years, 2 months ago
Reviewers:
Mark Mentovai
CC:
crashpad-dev_chromium.org
Base URL:
https://chromium.googlesource.com/crashpad/crashpad@save-teb
Target Ref:
refs/heads/master
Project:
crashpad
Visibility:
Public.

Description

win: Save contents of PEB to minidump to start making !peb work This makes the basics of !peb work in windbg, however, pointed-to things are not yet retrieved. For full functionality, a variety of pointers in the PEB also needs to be walked and captured. e.g. Previously: 0:000> .ecxr eax=00000007 ebx=7e383000 ecx=c3f9a943 edx=00000000 esi=006d62d0 edi=003c9280 eip=00384828 esp=005bf634 ebp=005bf638 iopl=0 nv up ei pl zr na pe nc cs=0023 ss=002b ds=002b es=002b fs=0053 gs=002b efl=00010246 crashy_program!crashpad::`anonymous namespace'::SomeCrashyFunction+0x28: 00384828 c7002a000000 mov dword ptr [eax],2Ah ds:002b:00000007=???????? 0:000> !peb PEB at 7e383000 error 1 InitTypeRead( nt!_PEB at 7e383000)... Now: 0:000> .ecxr eax=00000007 ebx=7f958000 ecx=02102f4d edx=00000000 esi=00e162d0 edi=01389280 eip=01344828 esp=00c2fb64 ebp=00c2fb68 iopl=0 nv up ei pl zr na pe nc cs=0023 ss=002b ds=002b es=002b fs=0053 gs=002b efl=00010246 crashy_program!crashpad::`anonymous namespace'::SomeCrashyFunction+0x28: 01344828 c7002a000000 mov dword ptr [eax],2Ah ds:002b:00000007=???????? 0:000> !peb PEB at 7f958000 InheritedAddressSpace: No ReadImageFileExecOptions: No BeingDebugged: No ImageBaseAddress: 01340000 Ldr 77ec8b40 *** unable to read Ldr table at 77ec8b40 SubSystemData: 00000000 ProcessHeap: 00e10000 ProcessParameters: 00e114e0 CurrentDirectory: '< Name not readable >' WindowTitle: '< Name not readable >' ImageFile: '< Name not readable >' CommandLine: '< Name not readable >' DllPath: '< Name not readable >' Environment: 00000000 Unable to read Environment string. R=mark@chromium.org BUG=crashpad:46 Committed: https://chromium.googlesource.com/crashpad/crashpad/+/0758dbde9a39fcc965d18f1791082daa6add40aa

Patch Set 1 #

Patch Set 2 : test #

Total comments: 12

Patch Set 3 : . #

Patch Set 4 : . #

Patch Set 5 : mac #

Patch Set 6 : mac2 #

Total comments: 17

Patch Set 7 : fixes #

Total comments: 2
Unified diffs Side-by-side diffs Delta from patch set Stats (+116 lines, -15 lines) Patch
M minidump/minidump_file_writer.cc View 1 2 3 4 5 6 1 chunk +2 lines, -0 lines 2 comments Download
M minidump/minidump_file_writer_test.cc View 1 2 3 4 5 6 3 chunks +16 lines, -0 lines 0 comments Download
M snapshot/mac/process_snapshot_mac.h View 1 2 3 4 1 chunk +1 line, -0 lines 0 comments Download
M snapshot/mac/process_snapshot_mac.cc View 1 2 3 4 1 chunk +5 lines, -0 lines 0 comments Download
M snapshot/minidump/process_snapshot_minidump.h View 1 2 3 4 5 6 2 chunks +2 lines, -0 lines 0 comments Download
M snapshot/minidump/process_snapshot_minidump.cc View 1 2 3 1 chunk +7 lines, -0 lines 0 comments Download
M snapshot/process_snapshot.h View 1 2 3 4 5 6 2 chunks +10 lines, -0 lines 0 comments Download
M snapshot/test/test_process_snapshot.h View 1 2 3 4 5 6 4 chunks +11 lines, -0 lines 0 comments Download
M snapshot/test/test_process_snapshot.cc View 1 2 3 4 5 6 2 chunks +9 lines, -1 line 0 comments Download
M snapshot/win/process_reader_win.h View 1 2 3 2 chunks +3 lines, -3 lines 0 comments Download
M snapshot/win/process_reader_win.cc View 1 2 3 1 chunk +5 lines, -0 lines 0 comments Download
M snapshot/win/process_reader_win_test.cc View 1 2 3 1 chunk +1 line, -1 line 0 comments Download
M snapshot/win/process_snapshot_win.h View 1 2 3 chunks +4 lines, -0 lines 0 comments Download
M snapshot/win/process_snapshot_win.cc View 1 2 3 3 chunks +13 lines, -2 lines 0 comments Download
M util/win/process_info.h View 1 2 3 3 chunks +11 lines, -1 line 0 comments Download
M util/win/process_info.cc View 1 2 3 7 chunks +16 lines, -7 lines 0 comments Download

Depends on Patchset:

Messages

Total messages: 12 (1 generated)
scottmg
5 years, 3 months ago (2015-09-23 21:28:32 UTC) #1
Mark Mentovai
I’m curious about these: CurrentDirectory: '< Name not readable >' Are the addresses for those ...
5 years, 3 months ago (2015-09-23 21:40:50 UTC) #2
Mark Mentovai
This tells me that at least some of this stuff is pretty discontiguous: PEB at ...
5 years, 3 months ago (2015-09-23 21:41:51 UTC) #3
scottmg
On 2015/09/23 21:40:50, Mark Mentovai - August is over wrote: > I’m curious about these: ...
5 years, 3 months ago (2015-09-23 22:15:08 UTC) #4
Mark Mentovai
Perhaps both ProcessSnapshot and ThreadSnapshot (and ModuleSnapshot, if you want the first few pages of ...
5 years, 3 months ago (2015-09-24 01:57:02 UTC) #5
scottmg
Thanks, ExtraMemory() seems like a good idea. I still only included the root of the ...
5 years, 3 months ago (2015-09-24 20:00:10 UTC) #6
Mark Mentovai
LGTM https://codereview.chromium.org/1364053002/diff/100001/minidump/minidump_file_writer.cc File minidump/minidump_file_writer.cc (right): https://codereview.chromium.org/1364053002/diff/100001/minidump/minidump_file_writer.cc#newcode82 minidump/minidump_file_writer.cc:82: memory_list->AddFromSnapshot(process_snapshot->ExtraMemory()); Was there a significance to this position? ...
5 years, 2 months ago (2015-09-25 17:05:35 UTC) #7
scottmg
https://codereview.chromium.org/1364053002/diff/100001/minidump/minidump_file_writer.cc File minidump/minidump_file_writer.cc (right): https://codereview.chromium.org/1364053002/diff/100001/minidump/minidump_file_writer.cc#newcode82 minidump/minidump_file_writer.cc:82: memory_list->AddFromSnapshot(process_snapshot->ExtraMemory()); On 2015/09/25 17:05:34, Mark Mentovai - August is ...
5 years, 2 months ago (2015-09-25 17:29:31 UTC) #9
scottmg
Committed patchset #7 (id:140001) manually as 0758dbde9a39fcc965d18f1791082daa6add40aa (presubmit successful).
5 years, 2 months ago (2015-09-25 17:31:09 UTC) #10
Mark Mentovai
https://codereview.chromium.org/1364053002/diff/100001/snapshot/process_snapshot.h File snapshot/process_snapshot.h (right): https://codereview.chromium.org/1364053002/diff/100001/snapshot/process_snapshot.h#newcode168 snapshot/process_snapshot.h:168: //! \return An std::vector<const MemorySnapshot*> that will be included ...
5 years, 2 months ago (2015-09-25 17:32:32 UTC) #11
scottmg
5 years, 2 months ago (2015-09-25 19:20:34 UTC) #12
Message was sent while issue was closed.
https://codereview.chromium.org/1364053002/diff/140001/minidump/minidump_file...
File minidump/minidump_file_writer.cc (right):

https://codereview.chromium.org/1364053002/diff/140001/minidump/minidump_file...
minidump/minidump_file_writer.cc:96:
memory_list->AddFromSnapshot(process_snapshot->ExtraMemory());
On 2015/09/25 17:32:32, Mark Mentovai - August is over wrote:
> It’s OK to do this after the crashpad_info stuff, but right here, it’s in the
> middle of the crashpad_info.

Hmm, you're right. OK, at the end it is:
https://codereview.chromium.org/1369823002.

Powered by Google App Engine
This is Rietveld 408576698