/// information parsing. The actual data is supplied through pure virtual
/// methods that a concrete implementation provides.
class DWARFContext : public DIContext {
- typedef SmallVector<DWARFCompileUnit *, 1> CUVector;
- typedef SmallVector<DWARFTypeUnit *, 1> TUVector;
+ typedef SmallVector<std::unique_ptr<DWARFCompileUnit>, 1> CUVector;
+ typedef SmallVector<std::unique_ptr<DWARFTypeUnit>, 1> TUVector;
CUVector CUs;
TUVector TUs;
CUVector DWOCUs;
TUVector DWOTUs;
std::unique_ptr<DWARFDebugAbbrev> AbbrevDWO;
+ std::unique_ptr<DWARFDebugLocDWO> LocDWO;
DWARFContext(DWARFContext &) LLVM_DELETED_FUNCTION;
DWARFContext &operator=(DWARFContext &) LLVM_DELETED_FUNCTION;
};
DWARFContext() : DIContext(CK_DWARF) {}
- virtual ~DWARFContext();
static bool classof(const DIContext *DICtx) {
return DICtx->getKind() == CK_DWARF;
/// Get the compile unit at the specified index for this compile unit.
DWARFCompileUnit *getCompileUnitAtIndex(unsigned index) {
parseCompileUnits();
- return CUs[index];
+ return CUs[index].get();
}
/// Get the compile unit at the specified index for the DWO compile units.
DWARFCompileUnit *getDWOCompileUnitAtIndex(unsigned index) {
parseDWOCompileUnits();
- return DWOCUs[index];
+ return DWOCUs[index].get();
}
/// Get a pointer to the parsed DebugAbbrev object.
/// Get a pointer to the parsed dwo abbreviations object.
const DWARFDebugAbbrev *getDebugAbbrevDWO();
+ /// Get a pointer to the parsed DebugLoc object.
+ const DWARFDebugLocDWO *getDebugLocDWO();
+
/// Get a pointer to the parsed DebugAranges object.
const DWARFDebugAranges *getDebugAranges();
virtual const TypeSectionMap &getTypesSections() = 0;
virtual StringRef getAbbrevSection() = 0;
virtual const Section &getLocSection() = 0;
+ virtual const Section &getLocDWOSection() = 0;
virtual StringRef getARangeSection() = 0;
virtual StringRef getDebugFrameSection() = 0;
virtual const Section &getLineSection() = 0;
TypeSectionMap TypesSections;
StringRef AbbrevSection;
Section LocSection;
+ Section LocDWOSection;
StringRef ARangeSection;
StringRef DebugFrameSection;
Section LineSection;
StringRef RangeDWOSection;
StringRef AddrSection;
- SmallVector<MemoryBuffer*, 4> UncompressedSections;
+ SmallVector<SmallString<32>, 4> UncompressedSections;
public:
DWARFContextInMemory(object::ObjectFile *);
- ~DWARFContextInMemory();
bool isLittleEndian() const override { return IsLittleEndian; }
uint8_t getAddressSize() const override { return AddressSize; }
const Section &getInfoSection() override { return InfoSection; }
const TypeSectionMap &getTypesSections() override { return TypesSections; }
StringRef getAbbrevSection() override { return AbbrevSection; }
const Section &getLocSection() override { return LocSection; }
+ const Section &getLocDWOSection() override { return LocDWOSection; }
StringRef getARangeSection() override { return ARangeSection; }
StringRef getDebugFrameSection() override { return DebugFrameSection; }
const Section &getLineSection() override { return LineSection; }