#include "DWARFDebugInfoEntry.h"
#include "DWARFDebugRangeList.h"
#include "DWARFRelocMap.h"
+#include "DWARFSection.h"
#include <vector>
namespace llvm {
class DWARFContext;
class DWARFDebugAbbrev;
+class DWARFUnit;
class StringRef;
class raw_ostream;
-class DWARFUnit;
/// Base class for all DWARFUnitSection classes. This provides the
/// functionality common to all unit types.
/// same section this Unit originated from.
virtual DWARFUnit *getUnitForOffset(uint32_t Offset) const = 0;
- void parse(DWARFContext &C, StringRef SectionData, const RelocAddrMap &Map);
- void parseDWO(DWARFContext &C, StringRef SectionData, const RelocAddrMap &Map);
+ void parse(DWARFContext &C, const DWARFSection &Section);
+ void parseDWO(DWARFContext &C, const DWARFSection &DWOSection);
protected:
- virtual void parseImpl(DWARFContext &Context, const DWARFDebugAbbrev *DA,
- StringRef Section, StringRef RS, StringRef SS,
- StringRef SOS, StringRef AOS, const RelocAddrMap &M,
- bool isLittleEndian) = 0;
+ virtual void parseImpl(DWARFContext &Context, const DWARFSection &Section,
+ const DWARFDebugAbbrev *DA, StringRef RS, StringRef SS,
+ StringRef SOS, StringRef AOS, bool isLittleEndian) = 0;
~DWARFUnitSectionBase() {}
};
return nullptr;
}
- private:
- void parseImpl(DWARFContext &Context, const DWARFDebugAbbrev *DA,
- StringRef Section, StringRef RS, StringRef SS, StringRef SOS,
- StringRef AOS, const RelocAddrMap &M, bool LE) override {
+private:
+ void parseImpl(DWARFContext &Context, const DWARFSection &Section,
+ const DWARFDebugAbbrev *DA, StringRef RS, StringRef SS,
+ StringRef SOS, StringRef AOS, bool LE) override {
if (Parsed)
return;
- DataExtractor Data(Section, LE, 0);
+ DataExtractor Data(Section.Data, LE, 0);
uint32_t Offset = 0;
while (Data.isValidOffset(Offset)) {
auto U =
- llvm::make_unique<UnitType>(Context, DA, Section, RS, SS, SOS, AOS,
- &M, Data.isLittleEndian(), *this);
+ llvm::make_unique<UnitType>(Context, DA, Section.Data, RS, SS, SOS,
+ AOS, &Section.Relocs, LE, *this);
if (!U->extract(Data, &Offset))
break;
this->push_back(std::move(U));