| OLD | NEW |
| 1 // -*- mode: C++ -*- | 1 // -*- mode: C++ -*- |
| 2 | 2 |
| 3 // Copyright (c) 2010 Google Inc. All Rights Reserved. | 3 // Copyright (c) 2010 Google Inc. All Rights Reserved. |
| 4 // | 4 // |
| 5 // Redistribution and use in source and binary forms, with or without | 5 // Redistribution and use in source and binary forms, with or without |
| 6 // modification, are permitted provided that the following conditions are | 6 // modification, are permitted provided that the following conditions are |
| 7 // met: | 7 // met: |
| 8 // | 8 // |
| 9 // * Redistributions of source code must retain the above copyright | 9 // * Redistributions of source code must retain the above copyright |
| 10 // notice, this list of conditions and the following disclaimer. | 10 // notice, this list of conditions and the following disclaimer. |
| (...skipping 262 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 273 // length in bytes, including any padding for aligned pointers. | 273 // length in bytes, including any padding for aligned pointers. |
| 274 // | 274 // |
| 275 // This function calls 'abort' if ENCODING is invalid or refers to a | 275 // This function calls 'abort' if ENCODING is invalid or refers to a |
| 276 // base address this reader hasn't been given, so you should check | 276 // base address this reader hasn't been given, so you should check |
| 277 // with ValidEncoding and UsableEncoding first if you would rather | 277 // with ValidEncoding and UsableEncoding first if you would rather |
| 278 // die in a more helpful way. | 278 // die in a more helpful way. |
| 279 uint64 ReadEncodedPointer(const uint8_t *buffer, | 279 uint64 ReadEncodedPointer(const uint8_t *buffer, |
| 280 DwarfPointerEncoding encoding, | 280 DwarfPointerEncoding encoding, |
| 281 size_t *len) const; | 281 size_t *len) const; |
| 282 | 282 |
| 283 Endianness GetEndianness() const; |
| 283 private: | 284 private: |
| 284 | 285 |
| 285 // Function pointer type for our address and offset readers. | 286 // Function pointer type for our address and offset readers. |
| 286 typedef uint64 (ByteReader::*AddressReader)(const uint8_t *) const; | 287 typedef uint64 (ByteReader::*AddressReader)(const uint8_t *) const; |
| 287 | 288 |
| 288 // Read an offset from BUFFER and return it as an unsigned 64 bit | 289 // Read an offset from BUFFER and return it as an unsigned 64 bit |
| 289 // integer. DWARF2/3 define offsets as either 4 or 8 bytes, | 290 // integer. DWARF2/3 define offsets as either 4 or 8 bytes, |
| 290 // generally depending on the amount of DWARF2/3 info present. | 291 // generally depending on the amount of DWARF2/3 info present. |
| 291 // This function pointer gets set by SetOffsetSize. | 292 // This function pointer gets set by SetOffsetSize. |
| 292 AddressReader offset_reader_; | 293 AddressReader offset_reader_; |
| (...skipping 12 matching lines...) Expand all Loading... |
| 305 // Base addresses for Linux C++ exception handling data's encoded pointers. | 306 // Base addresses for Linux C++ exception handling data's encoded pointers. |
| 306 bool have_section_base_, have_text_base_, have_data_base_; | 307 bool have_section_base_, have_text_base_, have_data_base_; |
| 307 bool have_function_base_; | 308 bool have_function_base_; |
| 308 uint64 section_base_, text_base_, data_base_, function_base_; | 309 uint64 section_base_, text_base_, data_base_, function_base_; |
| 309 const uint8_t *buffer_base_; | 310 const uint8_t *buffer_base_; |
| 310 }; | 311 }; |
| 311 | 312 |
| 312 } // namespace dwarf2reader | 313 } // namespace dwarf2reader |
| 313 | 314 |
| 314 #endif // COMMON_DWARF_BYTEREADER_H__ | 315 #endif // COMMON_DWARF_BYTEREADER_H__ |
| OLD | NEW |