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

Side by Side Diff: minidump/minidump_file_writer.cc

Issue 1369823002: Better location for adding ExtraMemory snapshots (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 unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 75 matching lines...) Expand 10 before | Expand all | Expand 10 after
86 AddStream(exception.Pass()); 86 AddStream(exception.Pass());
87 } 87 }
88 88
89 auto module_list = make_scoped_ptr(new MinidumpModuleListWriter()); 89 auto module_list = make_scoped_ptr(new MinidumpModuleListWriter());
90 module_list->InitializeFromSnapshot(process_snapshot->Modules()); 90 module_list->InitializeFromSnapshot(process_snapshot->Modules());
91 AddStream(module_list.Pass()); 91 AddStream(module_list.Pass());
92 92
93 auto crashpad_info = make_scoped_ptr(new MinidumpCrashpadInfoWriter()); 93 auto crashpad_info = make_scoped_ptr(new MinidumpCrashpadInfoWriter());
94 crashpad_info->InitializeFromSnapshot(process_snapshot); 94 crashpad_info->InitializeFromSnapshot(process_snapshot);
95 95
96 memory_list->AddFromSnapshot(process_snapshot->ExtraMemory());
97
98 // Since the MinidumpCrashpadInfo stream is an extension, it’s safe to not add 96 // Since the MinidumpCrashpadInfo stream is an extension, it’s safe to not add
99 // it to the minidump file if it wouldn’t carry any useful information. 97 // it to the minidump file if it wouldn’t carry any useful information.
100 if (crashpad_info->IsUseful()) { 98 if (crashpad_info->IsUseful()) {
101 AddStream(crashpad_info.Pass()); 99 AddStream(crashpad_info.Pass());
102 } 100 }
103 101
102 memory_list->AddFromSnapshot(process_snapshot->ExtraMemory());
103
104 AddStream(memory_list.Pass()); 104 AddStream(memory_list.Pass());
105 } 105 }
106 106
107 void MinidumpFileWriter::SetTimestamp(time_t timestamp) { 107 void MinidumpFileWriter::SetTimestamp(time_t timestamp) {
108 DCHECK_EQ(state(), kStateMutable); 108 DCHECK_EQ(state(), kStateMutable);
109 109
110 internal::MinidumpWriterUtil::AssignTimeT(&header_.TimeDateStamp, timestamp); 110 internal::MinidumpWriterUtil::AssignTimeT(&header_.TimeDateStamp, timestamp);
111 } 111 }
112 112
113 void MinidumpFileWriter::AddStream( 113 void MinidumpFileWriter::AddStream(
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after
222 for (internal::MinidumpStreamWriter* stream : streams_) { 222 for (internal::MinidumpStreamWriter* stream : streams_) {
223 iov.iov_base = stream->DirectoryListEntry(); 223 iov.iov_base = stream->DirectoryListEntry();
224 iov.iov_len = sizeof(MINIDUMP_DIRECTORY); 224 iov.iov_len = sizeof(MINIDUMP_DIRECTORY);
225 iovecs.push_back(iov); 225 iovecs.push_back(iov);
226 } 226 }
227 227
228 return file_writer->WriteIoVec(&iovecs); 228 return file_writer->WriteIoVec(&iovecs);
229 } 229 }
230 230
231 } // namespace crashpad 231 } // namespace crashpad
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698