OLD | NEW |
1 // Copyright (c) 2010 Google Inc. All Rights Reserved. | 1 // Copyright (c) 2010 Google Inc. All Rights Reserved. |
2 // | 2 // |
3 // Redistribution and use in source and binary forms, with or without | 3 // Redistribution and use in source and binary forms, with or without |
4 // modification, are permitted provided that the following conditions are | 4 // modification, are permitted provided that the following conditions are |
5 // met: | 5 // met: |
6 // | 6 // |
7 // * Redistributions of source code must retain the above copyright | 7 // * Redistributions of source code must retain the above copyright |
8 // notice, this list of conditions and the following disclaimer. | 8 // notice, this list of conditions and the following disclaimer. |
9 // * Redistributions in binary form must reproduce the above | 9 // * Redistributions in binary form must reproduce the above |
10 // copyright notice, this list of conditions and the following disclaimer | 10 // copyright notice, this list of conditions and the following disclaimer |
(...skipping 248 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
259 header_.length = initial_length; | 259 header_.length = initial_length; |
260 | 260 |
261 assert(headerptr + 2 < buffer_ + buffer_length_); | 261 assert(headerptr + 2 < buffer_ + buffer_length_); |
262 header_.version = reader_->ReadTwoBytes(headerptr); | 262 header_.version = reader_->ReadTwoBytes(headerptr); |
263 headerptr += 2; | 263 headerptr += 2; |
264 | 264 |
265 assert(headerptr + reader_->OffsetSize() < buffer_ + buffer_length_); | 265 assert(headerptr + reader_->OffsetSize() < buffer_ + buffer_length_); |
266 header_.abbrev_offset = reader_->ReadOffset(headerptr); | 266 header_.abbrev_offset = reader_->ReadOffset(headerptr); |
267 headerptr += reader_->OffsetSize(); | 267 headerptr += reader_->OffsetSize(); |
268 | 268 |
269 assert(headerptr + 1 < buffer_ + buffer_length_); | 269 // Compare against less than or equal because this may be the last |
| 270 // section in the file. |
| 271 assert(headerptr + 1 <= buffer_ + buffer_length_); |
270 header_.address_size = reader_->ReadOneByte(headerptr); | 272 header_.address_size = reader_->ReadOneByte(headerptr); |
271 reader_->SetAddressSize(header_.address_size); | 273 reader_->SetAddressSize(header_.address_size); |
272 headerptr += 1; | 274 headerptr += 1; |
273 | 275 |
274 after_header_ = headerptr; | 276 after_header_ = headerptr; |
275 | 277 |
276 // This check ensures that we don't have to do checking during the | 278 // This check ensures that we don't have to do checking during the |
277 // reading of DIEs. header_.length does not include the size of the | 279 // reading of DIEs. header_.length does not include the size of the |
278 // initial length. | 280 // initial length. |
279 assert(buffer_ + initial_length_size + header_.length <= | 281 assert(buffer_ + initial_length_size + header_.length <= |
(...skipping 2443 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2723 uint64 insn_offset) { | 2725 uint64 insn_offset) { |
2724 fprintf(stderr, | 2726 fprintf(stderr, |
2725 "%s: CFI %s at offset 0x%llx in section '%s':" | 2727 "%s: CFI %s at offset 0x%llx in section '%s':" |
2726 " the DW_CFA_restore_state instruction at offset 0x%llx" | 2728 " the DW_CFA_restore_state instruction at offset 0x%llx" |
2727 " would clear the CFA rule in effect\n", | 2729 " would clear the CFA rule in effect\n", |
2728 filename_.c_str(), CallFrameInfo::KindName(kind), offset, | 2730 filename_.c_str(), CallFrameInfo::KindName(kind), offset, |
2729 section_.c_str(), insn_offset); | 2731 section_.c_str(), insn_offset); |
2730 } | 2732 } |
2731 | 2733 |
2732 } // namespace dwarf2reader | 2734 } // namespace dwarf2reader |
OLD | NEW |