diff options
author | Sterling Augustine <saugustine@google.com> | 2020-10-02 07:44:24 -0700 |
---|---|---|
committer | Sterling Augustine <saugustine@google.com> | 2020-10-02 17:55:10 +0000 |
commit | f6669d6df42686aea832762f701359a3f9bdc762 (patch) | |
tree | 83c626021a72d4838ce3d570963cad0864f30f77 /src/common/dwarf | |
parent | Refactor rangelist handling to prepare for dwarf5 .debug_rngslist (diff) | |
download | breakpad-f6669d6df42686aea832762f701359a3f9bdc762.tar.xz |
This reverts commit 2b936b06c12657b684f6c7276d6ae5a24cb48ab5.
After getting deep into the dwarf5 range reader, I realized that this
should be done a somewhat different way. So reverting in favor or
a better design, coming in a few minutes.
Change-Id: Ie0b2846e70b3df1e637831e96ea69fe093f4e712
Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/2446011
Reviewed-by: Mark Mentovai <mark@chromium.org>
Diffstat (limited to 'src/common/dwarf')
-rw-r--r-- | src/common/dwarf/dwarf2reader.cc | 13 | ||||
-rw-r--r-- | src/common/dwarf/dwarf2reader.h | 6 |
2 files changed, 10 insertions, 9 deletions
diff --git a/src/common/dwarf/dwarf2reader.cc b/src/common/dwarf/dwarf2reader.cc index ab31a980..aca83677 100644 --- a/src/common/dwarf/dwarf2reader.cc +++ b/src/common/dwarf/dwarf2reader.cc @@ -1569,11 +1569,10 @@ void LineInfo::ReadLines() { } RangeListReader::RangeListReader(const uint8_t* buffer, uint64_t size, - ByteReader* reader) - : buffer_(buffer), size_(size), reader_(reader) { } + ByteReader* reader, RangeListHandler* handler) + : buffer_(buffer), size_(size), reader_(reader), handler_(handler) { } -bool RangeListReader::ReadRangeList(uint64_t offset, - RangeListHandler* handler) { +bool RangeListReader::ReadRangeList(uint64_t offset) { const uint64_t max_address = (reader_->AddressSize() == 4) ? 0xffffffffUL : 0xffffffffffffffffULL; @@ -1590,12 +1589,12 @@ bool RangeListReader::ReadRangeList(uint64_t offset, reader_->ReadAddress(buffer_ + offset + reader_->AddressSize()); if (start_address == max_address) { // Base address selection - handler->SetBaseAddress(end_address); + handler_->SetBaseAddress(end_address); } else if (start_address == 0 && end_address == 0) { // End-of-list - handler->Finish(); + handler_->Finish(); list_end = true; } else { // Add a range entry - handler->AddRange(start_address, end_address); + handler_->AddRange(start_address, end_address); } offset += entry_size; diff --git a/src/common/dwarf/dwarf2reader.h b/src/common/dwarf/dwarf2reader.h index aa9e270d..e405e3a7 100644 --- a/src/common/dwarf/dwarf2reader.h +++ b/src/common/dwarf/dwarf2reader.h @@ -243,14 +243,16 @@ class RangeListHandler { class RangeListReader { public: - RangeListReader(const uint8_t* buffer, uint64_t size, ByteReader* reader); + RangeListReader(const uint8_t* buffer, uint64_t size, ByteReader* reader, + RangeListHandler* handler); - bool ReadRangeList(uint64_t offset, RangeListHandler* handler); + bool ReadRangeList(uint64_t offset); private: const uint8_t* buffer_; uint64_t size_; ByteReader* reader_; + RangeListHandler* handler_; }; // This class is the main interface between the reader and the |