virtual ~DIContext();
/// getDWARFContext - get a context for binary DWARF data.
- static DIContext *getDWARFContext(object::ObjectFile &);
+ static DIContext *getDWARFContext(const object::ObjectFile &Obj);
virtual void dump(raw_ostream &OS, DIDumpType DumpType = DIDT_All) = 0;
/// @brief Base class for object file relocation visitors.
class RelocVisitor {
public:
- explicit RelocVisitor(ObjectFile &Obj)
+ explicit RelocVisitor(const ObjectFile &Obj)
: ObjToVisit(Obj), HasError(false) {}
// TODO: Should handle multiple applied relocations via either passing in the
bool error() { return HasError; }
private:
- ObjectFile &ObjToVisit;
+ const ObjectFile &ObjToVisit;
bool HasError;
RelocToApply visitELF(uint32_t RelocType, RelocationRef R, uint64_t Value) {
DIContext::~DIContext() {}
-DIContext *DIContext::getDWARFContext(object::ObjectFile &Obj) {
+DIContext *DIContext::getDWARFContext(const object::ObjectFile &Obj) {
return new DWARFContextInMemory(Obj);
}
return true;
}
-DWARFContextInMemory::DWARFContextInMemory(object::ObjectFile &Obj)
+DWARFContextInMemory::DWARFContextInMemory(const object::ObjectFile &Obj)
: IsLittleEndian(Obj.isLittleEndian()),
AddressSize(Obj.getBytesInAddress()) {
for (const SectionRef &Section : Obj.sections()) {
SmallVector<SmallString<32>, 4> UncompressedSections;
public:
- DWARFContextInMemory(object::ObjectFile &);
+ DWARFContextInMemory(const object::ObjectFile &Obj);
bool isLittleEndian() const override { return IsLittleEndian; }
uint8_t getAddressSize() const override { return AddressSize; }
const DWARFSection &getInfoSection() override { return InfoSection; }