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 181 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
192 return vmsize() + (SegmentSlides() ? 0 : slide_); | 192 return vmsize() + (SegmentSlides() ? 0 : slide_); |
193 } | 193 } |
194 | 194 |
195 const process_types::section* MachOImageSegmentReader::GetSectionByName( | 195 const process_types::section* MachOImageSegmentReader::GetSectionByName( |
196 const std::string& section_name, | 196 const std::string& section_name, |
197 mach_vm_address_t* address) const { | 197 mach_vm_address_t* address) const { |
198 INITIALIZATION_STATE_DCHECK_VALID(initialized_); | 198 INITIALIZATION_STATE_DCHECK_VALID(initialized_); |
199 | 199 |
200 const auto& iterator = section_map_.find(section_name); | 200 const auto& iterator = section_map_.find(section_name); |
201 if (iterator == section_map_.end()) { | 201 if (iterator == section_map_.end()) { |
202 return NULL; | 202 return nullptr; |
203 } | 203 } |
204 | 204 |
205 return GetSectionAtIndex(iterator->second, address); | 205 return GetSectionAtIndex(iterator->second, address); |
206 } | 206 } |
207 | 207 |
208 const process_types::section* MachOImageSegmentReader::GetSectionAtIndex( | 208 const process_types::section* MachOImageSegmentReader::GetSectionAtIndex( |
209 size_t index, | 209 size_t index, |
210 mach_vm_address_t* address) const { | 210 mach_vm_address_t* address) const { |
211 INITIALIZATION_STATE_DCHECK_VALID(initialized_); | 211 INITIALIZATION_STATE_DCHECK_VALID(initialized_); |
212 CHECK_LT(index, sections_.size()); | 212 CHECK_LT(index, sections_.size()); |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
266 } | 266 } |
267 | 267 |
268 void MachOImageSegmentReader::SetSlide(mach_vm_size_t slide) { | 268 void MachOImageSegmentReader::SetSlide(mach_vm_size_t slide) { |
269 INITIALIZATION_STATE_DCHECK_VALID(initialized_); | 269 INITIALIZATION_STATE_DCHECK_VALID(initialized_); |
270 INITIALIZATION_STATE_SET_INITIALIZING(initialized_slide_); | 270 INITIALIZATION_STATE_SET_INITIALIZING(initialized_slide_); |
271 slide_ = slide; | 271 slide_ = slide; |
272 INITIALIZATION_STATE_SET_VALID(initialized_slide_); | 272 INITIALIZATION_STATE_SET_VALID(initialized_slide_); |
273 } | 273 } |
274 | 274 |
275 } // namespace crashpad | 275 } // namespace crashpad |
OLD | NEW |