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

Side by Side Diff: minidump/minidump_file_writer.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 2014 The Crashpad Authors. All rights reserved. 1 // Copyright 2014 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 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
72 AddStream(misc_info.Pass()); 72 AddStream(misc_info.Pass());
73 73
74 auto memory_list = make_scoped_ptr(new MinidumpMemoryListWriter()); 74 auto memory_list = make_scoped_ptr(new MinidumpMemoryListWriter());
75 auto thread_list = make_scoped_ptr(new MinidumpThreadListWriter()); 75 auto thread_list = make_scoped_ptr(new MinidumpThreadListWriter());
76 thread_list->SetMemoryListWriter(memory_list.get()); 76 thread_list->SetMemoryListWriter(memory_list.get());
77 MinidumpThreadIDMap thread_id_map; 77 MinidumpThreadIDMap thread_id_map;
78 thread_list->InitializeFromSnapshot(process_snapshot->Threads(), 78 thread_list->InitializeFromSnapshot(process_snapshot->Threads(),
79 &thread_id_map); 79 &thread_id_map);
80 AddStream(thread_list.Pass()); 80 AddStream(thread_list.Pass());
81 81
82 auto peb = process_snapshot->Peb();
83 if (peb) {
84 std::vector<const MemorySnapshot*> peb_vector;
Mark Mentovai 2015/09/23 21:40:50 Use the (1, peb) constructor and skip the push_bac
scottmg 2015/09/24 20:00:10 Gone now that ExtraMemory() directly returns a vec
85 peb_vector.push_back(peb);
86 memory_list->AddFromSnapshot(peb_vector);
87 }
88
82 const ExceptionSnapshot* exception_snapshot = process_snapshot->Exception(); 89 const ExceptionSnapshot* exception_snapshot = process_snapshot->Exception();
83 if (exception_snapshot) { 90 if (exception_snapshot) {
84 auto exception = make_scoped_ptr(new MinidumpExceptionWriter()); 91 auto exception = make_scoped_ptr(new MinidumpExceptionWriter());
85 exception->InitializeFromSnapshot(exception_snapshot, thread_id_map); 92 exception->InitializeFromSnapshot(exception_snapshot, thread_id_map);
86 AddStream(exception.Pass()); 93 AddStream(exception.Pass());
87 } 94 }
88 95
89 auto module_list = make_scoped_ptr(new MinidumpModuleListWriter()); 96 auto module_list = make_scoped_ptr(new MinidumpModuleListWriter());
90 module_list->InitializeFromSnapshot(process_snapshot->Modules()); 97 module_list->InitializeFromSnapshot(process_snapshot->Modules());
91 AddStream(module_list.Pass()); 98 AddStream(module_list.Pass());
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after
220 for (internal::MinidumpStreamWriter* stream : streams_) { 227 for (internal::MinidumpStreamWriter* stream : streams_) {
221 iov.iov_base = stream->DirectoryListEntry(); 228 iov.iov_base = stream->DirectoryListEntry();
222 iov.iov_len = sizeof(MINIDUMP_DIRECTORY); 229 iov.iov_len = sizeof(MINIDUMP_DIRECTORY);
223 iovecs.push_back(iov); 230 iovecs.push_back(iov);
224 } 231 }
225 232
226 return file_writer->WriteIoVec(&iovecs); 233 return file_writer->WriteIoVec(&iovecs);
227 } 234 }
228 235
229 } // namespace crashpad 236 } // namespace crashpad
OLDNEW
« no previous file with comments | « no previous file | minidump/minidump_file_writer_test.cc » ('j') | minidump/minidump_file_writer_test.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698