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 252 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
263 //! For executable images (those with file type `MH_EXECUTE`), this is the | 263 //! For executable images (those with file type `MH_EXECUTE`), this is the |
264 //! name provided in the `LC_LOAD_DYLINKER` load command, if any. For dynamic | 264 //! name provided in the `LC_LOAD_DYLINKER` load command, if any. For dynamic |
265 //! linker images (those with file type `MH_DYLINKER`), this is the name | 265 //! linker images (those with file type `MH_DYLINKER`), this is the name |
266 //! provided in the `LC_ID_DYLINKER` load command. In other cases, this will | 266 //! provided in the `LC_ID_DYLINKER` load command. In other cases, this will |
267 //! be empty. | 267 //! be empty. |
268 std::string DylinkerName() const { return dylinker_name_; } | 268 std::string DylinkerName() const { return dylinker_name_; } |
269 | 269 |
270 //! \brief Obtains the module’s CrashpadInfo structure. | 270 //! \brief Obtains the module’s CrashpadInfo structure. |
271 //! | 271 //! |
272 //! \return `true` on success, `false` on failure. If the module does not have | 272 //! \return `true` on success, `false` on failure. If the module does not have |
273 //! a `__crashpad_info` section, this will return `false` without logging | 273 //! a `__DATA,crashpad_info` section, this will return `false` without |
274 //! any messages. Other failures will result in messages being logged. | 274 //! logging any messages. Other failures will result in messages being |
| 275 //! logged. |
275 bool GetCrashpadInfo(process_types::CrashpadInfo* crashpad_info) const; | 276 bool GetCrashpadInfo(process_types::CrashpadInfo* crashpad_info) const; |
276 | 277 |
277 private: | 278 private: |
278 // A generic helper routine for the other Read*Command() methods. | 279 // A generic helper routine for the other Read*Command() methods. |
279 template <typename T> | 280 template <typename T> |
280 bool ReadLoadCommand(mach_vm_address_t load_command_address, | 281 bool ReadLoadCommand(mach_vm_address_t load_command_address, |
281 const std::string& load_command_info, | 282 const std::string& load_command_info, |
282 uint32_t expected_load_command_id, | 283 uint32_t expected_load_command_id, |
283 T* load_command); | 284 T* load_command); |
284 | 285 |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
346 // set. symbol_table_initialized_ will be valid without symbol_table_ being | 347 // set. symbol_table_initialized_ will be valid without symbol_table_ being |
347 // set in modules that have no symbol table. | 348 // set in modules that have no symbol table. |
348 mutable InitializationState symbol_table_initialized_; | 349 mutable InitializationState symbol_table_initialized_; |
349 | 350 |
350 DISALLOW_COPY_AND_ASSIGN(MachOImageReader); | 351 DISALLOW_COPY_AND_ASSIGN(MachOImageReader); |
351 }; | 352 }; |
352 | 353 |
353 } // namespace crashpad | 354 } // namespace crashpad |
354 | 355 |
355 #endif // CRASHPAD_SNAPSHOT_MAC_MACH_O_IMAGE_READER_H_ | 356 #endif // CRASHPAD_SNAPSHOT_MAC_MACH_O_IMAGE_READER_H_ |
OLD | NEW |