| 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 247 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 258 //! | 258 //! |
| 259 //! The dynamic linker is normally /usr/lib/dyld. | 259 //! The dynamic linker is normally /usr/lib/dyld. |
| 260 //! | 260 //! |
| 261 //! For executable images (those with file type `MH_EXECUTE`), this is the | 261 //! For executable images (those with file type `MH_EXECUTE`), this is the |
| 262 //! name provided in the `LC_LOAD_DYLINKER` load command, if any. For dynamic | 262 //! name provided in the `LC_LOAD_DYLINKER` load command, if any. For dynamic |
| 263 //! linker images (those with file type `MH_DYLINKER`), this is the name | 263 //! linker images (those with file type `MH_DYLINKER`), this is the name |
| 264 //! provided in the `LC_ID_DYLINKER` load command. In other cases, this will | 264 //! provided in the `LC_ID_DYLINKER` load command. In other cases, this will |
| 265 //! be empty. | 265 //! be empty. |
| 266 std::string DylinkerName() const { return dylinker_name_; } | 266 std::string DylinkerName() const { return dylinker_name_; } |
| 267 | 267 |
| 268 //! \brief Obtains the module’s CrashpadInfo structure. |
| 269 //! |
| 270 //! \return `true` on success, `false` on failure. If the module does not have |
| 271 //! a `__crashpad_info` section, this will return `false` without logging |
| 272 //! any messages. Other failures will result in messages being logged. |
| 273 bool GetCrashpadInfo(process_types::CrashpadInfo* crashpad_info) const; |
| 274 |
| 268 private: | 275 private: |
| 269 // A generic helper routine for the other Read*Command() methods. | 276 // A generic helper routine for the other Read*Command() methods. |
| 270 template <typename T> | 277 template <typename T> |
| 271 bool ReadLoadCommand(mach_vm_address_t load_command_address, | 278 bool ReadLoadCommand(mach_vm_address_t load_command_address, |
| 272 const std::string& load_command_info, | 279 const std::string& load_command_info, |
| 273 uint32_t expected_load_command_id, | 280 uint32_t expected_load_command_id, |
| 274 T* load_command); | 281 T* load_command); |
| 275 | 282 |
| 276 // The Read*Command() methods are subroutines called by Initialize(). They are | 283 // The Read*Command() methods are subroutines called by Initialize(). They are |
| 277 // responsible for reading a single load command. They may update the member | 284 // responsible for reading a single load command. They may update the member |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 336 // set. symbol_table_initialized_ will be valid without symbol_table_ being | 343 // set. symbol_table_initialized_ will be valid without symbol_table_ being |
| 337 // set in modules that have no symbol table. | 344 // set in modules that have no symbol table. |
| 338 mutable InitializationState symbol_table_initialized_; | 345 mutable InitializationState symbol_table_initialized_; |
| 339 | 346 |
| 340 DISALLOW_COPY_AND_ASSIGN(MachOImageReader); | 347 DISALLOW_COPY_AND_ASSIGN(MachOImageReader); |
| 341 }; | 348 }; |
| 342 | 349 |
| 343 } // namespace crashpad | 350 } // namespace crashpad |
| 344 | 351 |
| 345 #endif // CRASHPAD_SNAPSHOT_MAC_MACH_O_IMAGE_READER_H_ | 352 #endif // CRASHPAD_SNAPSHOT_MAC_MACH_O_IMAGE_READER_H_ |
| OLD | NEW |