OLD | NEW |
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 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
143 DCHECK_EQ(state(), kStateMutable); | 143 DCHECK_EQ(state(), kStateMutable); |
144 DCHECK(threads_.empty()); | 144 DCHECK(threads_.empty()); |
145 | 145 |
146 BuildMinidumpThreadIDMap(thread_snapshots, thread_id_map); | 146 BuildMinidumpThreadIDMap(thread_snapshots, thread_id_map); |
147 | 147 |
148 for (const ThreadSnapshot* thread_snapshot : thread_snapshots) { | 148 for (const ThreadSnapshot* thread_snapshot : thread_snapshots) { |
149 auto thread = make_scoped_ptr(new MinidumpThreadWriter()); | 149 auto thread = make_scoped_ptr(new MinidumpThreadWriter()); |
150 thread->InitializeFromSnapshot(thread_snapshot, thread_id_map); | 150 thread->InitializeFromSnapshot(thread_snapshot, thread_id_map); |
151 AddThread(thread.Pass()); | 151 AddThread(thread.Pass()); |
152 } | 152 } |
| 153 |
| 154 // Do this in a separate loop to keep the thread stacks earlier in the dump, |
| 155 // and together. |
| 156 for (const ThreadSnapshot* thread_snapshot : thread_snapshots) |
| 157 memory_list_writer_->AddFromSnapshot(thread_snapshot->ExtraMemory()); |
153 } | 158 } |
154 | 159 |
155 void MinidumpThreadListWriter::SetMemoryListWriter( | 160 void MinidumpThreadListWriter::SetMemoryListWriter( |
156 MinidumpMemoryListWriter* memory_list_writer) { | 161 MinidumpMemoryListWriter* memory_list_writer) { |
157 DCHECK_EQ(state(), kStateMutable); | 162 DCHECK_EQ(state(), kStateMutable); |
158 DCHECK(threads_.empty()); | 163 DCHECK(threads_.empty()); |
159 | 164 |
160 memory_list_writer_ = memory_list_writer; | 165 memory_list_writer_ = memory_list_writer; |
161 } | 166 } |
162 | 167 |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
222 } | 227 } |
223 | 228 |
224 return file_writer->WriteIoVec(&iovecs); | 229 return file_writer->WriteIoVec(&iovecs); |
225 } | 230 } |
226 | 231 |
227 MinidumpStreamType MinidumpThreadListWriter::StreamType() const { | 232 MinidumpStreamType MinidumpThreadListWriter::StreamType() const { |
228 return kMinidumpStreamTypeThreadList; | 233 return kMinidumpStreamTypeThreadList; |
229 } | 234 } |
230 | 235 |
231 } // namespace crashpad | 236 } // namespace crashpad |
OLD | NEW |