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 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
69 } | 69 } |
70 | 70 |
71 bool MinidumpMemoryWriter::WillWriteAtOffsetImpl(off_t offset) { | 71 bool MinidumpMemoryWriter::WillWriteAtOffsetImpl(off_t offset) { |
72 DCHECK_EQ(state(), kStateFrozen); | 72 DCHECK_EQ(state(), kStateFrozen); |
73 | 73 |
74 // There will always be at least one registered descriptor, the one for this | 74 // There will always be at least one registered descriptor, the one for this |
75 // object’s own memory_descriptor_ field. | 75 // object’s own memory_descriptor_ field. |
76 DCHECK_GE(registered_memory_descriptors_.size(), 1u); | 76 DCHECK_GE(registered_memory_descriptors_.size(), 1u); |
77 | 77 |
78 uint64_t base_address = MemoryRangeBaseAddress(); | 78 uint64_t base_address = MemoryRangeBaseAddress(); |
79 typeof(registered_memory_descriptors_[0]->StartOfMemoryRange) local_address; | 79 decltype(registered_memory_descriptors_[0]->StartOfMemoryRange) local_address; |
80 if (!AssignIfInRange(&local_address, base_address)) { | 80 if (!AssignIfInRange(&local_address, base_address)) { |
81 LOG(ERROR) << "base_address " << base_address << " out of range"; | 81 LOG(ERROR) << "base_address " << base_address << " out of range"; |
82 return false; | 82 return false; |
83 } | 83 } |
84 | 84 |
85 for (MINIDUMP_MEMORY_DESCRIPTOR* memory_descriptor : | 85 for (MINIDUMP_MEMORY_DESCRIPTOR* memory_descriptor : |
86 registered_memory_descriptors_) { | 86 registered_memory_descriptors_) { |
87 memory_descriptor->StartOfMemoryRange = local_address; | 87 memory_descriptor->StartOfMemoryRange = local_address; |
88 } | 88 } |
89 | 89 |
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
179 } | 179 } |
180 | 180 |
181 return file_writer->WriteIoVec(&iovecs); | 181 return file_writer->WriteIoVec(&iovecs); |
182 } | 182 } |
183 | 183 |
184 MinidumpStreamType MinidumpMemoryListWriter::StreamType() const { | 184 MinidumpStreamType MinidumpMemoryListWriter::StreamType() const { |
185 return kMinidumpStreamTypeMemoryList; | 185 return kMinidumpStreamTypeMemoryList; |
186 } | 186 } |
187 | 187 |
188 } // namespace crashpad | 188 } // namespace crashpad |
OLD | NEW |