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

Side by Side Diff: snapshot/win/process_snapshot_win.cc

Issue 1364053002: win: Save contents of PEB to minidump (Closed) Base URL: https://chromium.googlesource.com/crashpad/crashpad@save-teb
Patch Set: test 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 unified diff | Download patch
OLDNEW
1 // Copyright 2015 The Crashpad Authors. All rights reserved. 1 // Copyright 2015 The Crashpad Authors. All rights reserved.
2 // 2 //
3 // Licensed under the Apache License, Version 2.0 (the "License"); 3 // Licensed under the Apache License, Version 2.0 (the "License");
4 // you may not use this file except in compliance with the License. 4 // you may not use this file except in compliance with the License.
5 // You may obtain a copy of the License at 5 // You may obtain a copy of the License at
6 // 6 //
7 // http://www.apache.org/licenses/LICENSE-2.0 7 // http://www.apache.org/licenses/LICENSE-2.0
8 // 8 //
9 // Unless required by applicable law or agreed to in writing, software 9 // Unless required by applicable law or agreed to in writing, software
10 // distributed under the License is distributed on an "AS IS" BASIS, 10 // distributed under the License is distributed on an "AS IS" BASIS,
(...skipping 30 matching lines...) Expand all
41 bool ProcessSnapshotWin::Initialize(HANDLE process, 41 bool ProcessSnapshotWin::Initialize(HANDLE process,
42 ProcessSuspensionState suspension_state) { 42 ProcessSuspensionState suspension_state) {
43 INITIALIZATION_STATE_SET_INITIALIZING(initialized_); 43 INITIALIZATION_STATE_SET_INITIALIZING(initialized_);
44 44
45 GetTimeOfDay(&snapshot_time_); 45 GetTimeOfDay(&snapshot_time_);
46 46
47 if (!process_reader_.Initialize(process, suspension_state)) 47 if (!process_reader_.Initialize(process, suspension_state))
48 return false; 48 return false;
49 49
50 system_.Initialize(&process_reader_); 50 system_.Initialize(&process_reader_);
51 WinVMAddress peb_address;
52 WinVMSize peb_size;
53 process_reader_.process_info().Peb(&peb_address, &peb_size);
54 peb_.Initialize(&process_reader_, peb_address, peb_size);
51 55
52 InitializeThreads(); 56 InitializeThreads();
53 InitializeModules(); 57 InitializeModules();
54 58
55 INITIALIZATION_STATE_SET_VALID(initialized_); 59 INITIALIZATION_STATE_SET_VALID(initialized_);
56 return true; 60 return true;
57 } 61 }
58 62
59 bool ProcessSnapshotWin::InitializeException( 63 bool ProcessSnapshotWin::InitializeException(
60 WinVMAddress exception_information_address) { 64 WinVMAddress exception_information_address) {
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
105 local_options.system_crash_reporter_forwarding != TriState::kUnset) { 109 local_options.system_crash_reporter_forwarding != TriState::kUnset) {
106 break; 110 break;
107 } 111 }
108 } 112 }
109 113
110 *options = local_options; 114 *options = local_options;
111 } 115 }
112 116
113 pid_t ProcessSnapshotWin::ProcessID() const { 117 pid_t ProcessSnapshotWin::ProcessID() const {
114 INITIALIZATION_STATE_DCHECK_VALID(initialized_); 118 INITIALIZATION_STATE_DCHECK_VALID(initialized_);
115 return process_reader_.ProcessID(); 119 return process_reader_.process_info().ProcessID();
116 } 120 }
117 121
118 pid_t ProcessSnapshotWin::ParentProcessID() const { 122 pid_t ProcessSnapshotWin::ParentProcessID() const {
119 INITIALIZATION_STATE_DCHECK_VALID(initialized_); 123 INITIALIZATION_STATE_DCHECK_VALID(initialized_);
120 return process_reader_.ParentProcessID(); 124 return process_reader_.process_info().ParentProcessID();
121 } 125 }
122 126
123 void ProcessSnapshotWin::SnapshotTime(timeval* snapshot_time) const { 127 void ProcessSnapshotWin::SnapshotTime(timeval* snapshot_time) const {
124 INITIALIZATION_STATE_DCHECK_VALID(initialized_); 128 INITIALIZATION_STATE_DCHECK_VALID(initialized_);
125 *snapshot_time = snapshot_time_; 129 *snapshot_time = snapshot_time_;
126 } 130 }
127 131
128 void ProcessSnapshotWin::ProcessStartTime(timeval* start_time) const { 132 void ProcessSnapshotWin::ProcessStartTime(timeval* start_time) const {
129 INITIALIZATION_STATE_DCHECK_VALID(initialized_); 133 INITIALIZATION_STATE_DCHECK_VALID(initialized_);
130 process_reader_.StartTime(start_time); 134 process_reader_.StartTime(start_time);
(...skipping 19 matching lines...) Expand all
150 ProcessSnapshotWin::AnnotationsSimpleMap() const { 154 ProcessSnapshotWin::AnnotationsSimpleMap() const {
151 INITIALIZATION_STATE_DCHECK_VALID(initialized_); 155 INITIALIZATION_STATE_DCHECK_VALID(initialized_);
152 return annotations_simple_map_; 156 return annotations_simple_map_;
153 } 157 }
154 158
155 const SystemSnapshot* ProcessSnapshotWin::System() const { 159 const SystemSnapshot* ProcessSnapshotWin::System() const {
156 INITIALIZATION_STATE_DCHECK_VALID(initialized_); 160 INITIALIZATION_STATE_DCHECK_VALID(initialized_);
157 return &system_; 161 return &system_;
158 } 162 }
159 163
164 const MemorySnapshot* ProcessSnapshotWin::Peb() const {
165 INITIALIZATION_STATE_DCHECK_VALID(initialized_);
166 return &peb_;
167 }
168
160 std::vector<const ThreadSnapshot*> ProcessSnapshotWin::Threads() const { 169 std::vector<const ThreadSnapshot*> ProcessSnapshotWin::Threads() const {
161 INITIALIZATION_STATE_DCHECK_VALID(initialized_); 170 INITIALIZATION_STATE_DCHECK_VALID(initialized_);
162 std::vector<const ThreadSnapshot*> threads; 171 std::vector<const ThreadSnapshot*> threads;
163 for (internal::ThreadSnapshotWin* thread : threads_) { 172 for (internal::ThreadSnapshotWin* thread : threads_) {
164 threads.push_back(thread); 173 threads.push_back(thread);
165 } 174 }
166 return threads; 175 return threads;
167 } 176 }
168 177
169 std::vector<const ModuleSnapshot*> ProcessSnapshotWin::Modules() const { 178 std::vector<const ModuleSnapshot*> ProcessSnapshotWin::Modules() const {
(...skipping 27 matching lines...) Expand all
197 for (const ProcessInfo::Module& process_reader_module : 206 for (const ProcessInfo::Module& process_reader_module :
198 process_reader_modules) { 207 process_reader_modules) {
199 auto module = make_scoped_ptr(new internal::ModuleSnapshotWin()); 208 auto module = make_scoped_ptr(new internal::ModuleSnapshotWin());
200 if (module->Initialize(&process_reader_, process_reader_module)) { 209 if (module->Initialize(&process_reader_, process_reader_module)) {
201 modules_.push_back(module.release()); 210 modules_.push_back(module.release());
202 } 211 }
203 } 212 }
204 } 213 }
205 214
206 } // namespace crashpad 215 } // namespace crashpad
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698