summaryrefslogtreecommitdiff
path: root/lib/DebugInfo/DWARFContext.h
diff options
context:
space:
mode:
authorDavid Blaikie <dblaikie@gmail.com>2013-09-23 17:42:01 +0000
committerDavid Blaikie <dblaikie@gmail.com>2013-09-23 17:42:01 +0000
commit9528b0e466ace36268abe9d011fffc67d831088c (patch)
tree2bd7af88cd009b421bc6f0312d3a9bb4ac88dab7 /lib/DebugInfo/DWARFContext.h
parentb3350acc2634e5a5ba723c99beddcbf8f2ad58ea (diff)
downloadllvm-9528b0e466ace36268abe9d011fffc67d831088c.tar.gz
llvm-9528b0e466ace36268abe9d011fffc67d831088c.tar.bz2
llvm-9528b0e466ace36268abe9d011fffc67d831088c.tar.xz
DebugInfo: Wrap section data and relocs together for dwarf dumping support
This is a small step that may enable some simplifications in producer (DWARFContext) and consumer (DWARFCompileUnit and other places) by making a more complete abstraction around the data and relocations for a section. Small initial steps could include simple changes such as passing the pair to DWARFCompileUnit's ctor rather than passing the data and relocs separately. I don't intend to pursue any such changes immediately, however. The motivation for doing this now is that type unit dumping will need to deal with these data+reloc pairs moreso than the existing dumping support has needed to associate the data as type unit sections are named the same (debug_types) and comdat group folded. So to implement dumping and reloc handling we'll need a mapping of section->data+relocs. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@191209 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/DebugInfo/DWARFContext.h')
-rw-r--r--lib/DebugInfo/DWARFContext.h43
1 files changed, 17 insertions, 26 deletions
diff --git a/lib/DebugInfo/DWARFContext.h b/lib/DebugInfo/DWARFContext.h
index e4b640e4c9..cda4475482 100644
--- a/lib/DebugInfo/DWARFContext.h
+++ b/lib/DebugInfo/DWARFContext.h
@@ -48,6 +48,11 @@ class DWARFContext : public DIContext {
void parseDWOCompileUnits();
public:
+ struct Section {
+ StringRef Data;
+ RelocAddrMap Relocs;
+ };
+
DWARFContext() : DIContext(CK_DWARF) {}
virtual ~DWARFContext();
@@ -113,28 +118,24 @@ public:
virtual bool isLittleEndian() const = 0;
virtual uint8_t getAddressSize() const = 0;
- virtual const RelocAddrMap &infoRelocMap() const = 0;
- virtual const RelocAddrMap &lineRelocMap() const = 0;
- virtual const RelocAddrMap &locRelocMap() const = 0;
- virtual StringRef getInfoSection() = 0;
+ virtual const Section &getInfoSection() = 0;
virtual StringRef getAbbrevSection() = 0;
- virtual StringRef getLocSection() = 0;
+ virtual const Section &getLocSection() = 0;
virtual StringRef getARangeSection() = 0;
virtual StringRef getDebugFrameSection() = 0;
- virtual StringRef getLineSection() = 0;
+ virtual const Section &getLineSection() = 0;
virtual StringRef getStringSection() = 0;
virtual StringRef getRangeSection() = 0;
virtual StringRef getPubNamesSection() = 0;
virtual StringRef getGnuPubNamesSection() = 0;
// Sections for DWARF5 split dwarf proposal.
- virtual StringRef getInfoDWOSection() = 0;
+ virtual const Section &getInfoDWOSection() = 0;
virtual StringRef getAbbrevDWOSection() = 0;
virtual StringRef getStringDWOSection() = 0;
virtual StringRef getStringOffsetDWOSection() = 0;
virtual StringRef getRangeDWOSection() = 0;
virtual StringRef getAddrSection() = 0;
- virtual const RelocAddrMap &infoDWORelocMap() const = 0;
static bool isSupportedVersion(unsigned version) {
return version == 2 || version == 3 || version == 4;
@@ -155,23 +156,19 @@ class DWARFContextInMemory : public DWARFContext {
virtual void anchor();
bool IsLittleEndian;
uint8_t AddressSize;
- RelocAddrMap InfoRelocMap;
- RelocAddrMap LocRelocMap;
- RelocAddrMap LineRelocMap;
- StringRef InfoSection;
+ Section InfoSection;
StringRef AbbrevSection;
- StringRef LocSection;
+ Section LocSection;
StringRef ARangeSection;
StringRef DebugFrameSection;
- StringRef LineSection;
+ Section LineSection;
StringRef StringSection;
StringRef RangeSection;
StringRef PubNamesSection;
StringRef GnuPubNamesSection;
// Sections for DWARF5 split dwarf proposal.
- RelocAddrMap InfoDWORelocMap;
- StringRef InfoDWOSection;
+ Section InfoDWOSection;
StringRef AbbrevDWOSection;
StringRef StringDWOSection;
StringRef StringOffsetDWOSection;
@@ -185,22 +182,19 @@ public:
~DWARFContextInMemory();
virtual bool isLittleEndian() const { return IsLittleEndian; }
virtual uint8_t getAddressSize() const { return AddressSize; }
- virtual const RelocAddrMap &infoRelocMap() const { return InfoRelocMap; }
- virtual const RelocAddrMap &locRelocMap() const { return LocRelocMap; }
- virtual const RelocAddrMap &lineRelocMap() const { return LineRelocMap; }
- virtual StringRef getInfoSection() { return InfoSection; }
+ virtual const Section &getInfoSection() { return InfoSection; }
virtual StringRef getAbbrevSection() { return AbbrevSection; }
- virtual StringRef getLocSection() { return LocSection; }
+ virtual const Section &getLocSection() { return LocSection; }
virtual StringRef getARangeSection() { return ARangeSection; }
virtual StringRef getDebugFrameSection() { return DebugFrameSection; }
- virtual StringRef getLineSection() { return LineSection; }
+ virtual const Section &getLineSection() { return LineSection; }
virtual StringRef getStringSection() { return StringSection; }
virtual StringRef getRangeSection() { return RangeSection; }
virtual StringRef getPubNamesSection() { return PubNamesSection; }
virtual StringRef getGnuPubNamesSection() { return GnuPubNamesSection; }
// Sections for DWARF5 split dwarf proposal.
- virtual StringRef getInfoDWOSection() { return InfoDWOSection; }
+ virtual const Section &getInfoDWOSection() { return InfoDWOSection; }
virtual StringRef getAbbrevDWOSection() { return AbbrevDWOSection; }
virtual StringRef getStringDWOSection() { return StringDWOSection; }
virtual StringRef getStringOffsetDWOSection() {
@@ -210,9 +204,6 @@ public:
virtual StringRef getAddrSection() {
return AddrSection;
}
- virtual const RelocAddrMap &infoDWORelocMap() const {
- return InfoDWORelocMap;
- }
};
}