llvm-6502/lib/DebugInfo/DWARFAcceleratorTable.h
Frederic Riss 4ad9e9b0b0 [dwarfdump] Handle relocations in Dwarf accelerator tables
ELF targets (and maybe COFF) use relocations when referring
to strings in the .debug_str section. Handle that in the
accelerator table dumper. This commit restores the
test/DebugInfo/cross-cu-inlining.ll test to its expected
platform independant form, validating that the fix works
(this test failed on linux boxes).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@222029 91177308-0d34-0410-b5e6-96231b3b80d8
2014-11-14 19:30:08 +00:00

43 lines
918 B
C++

#include "DWARFRelocMap.h"
#include "llvm/ADT/SmallVector.h"
#include "llvm/DebugInfo/DWARFFormValue.h"
#include <cstdint>
namespace llvm {
class DWARFAcceleratorTable {
struct Header {
uint32_t Magic;
uint16_t Version;
uint16_t HashFunction;
uint32_t NumBuckets;
uint32_t NumHashes;
uint32_t HeaderDataLength;
};
struct HeaderData {
typedef uint16_t AtomType;
uint32_t DIEOffsetBase;
SmallVector<std::pair<AtomType, DWARFFormValue>, 1> Atoms;
};
struct Header Hdr;
struct HeaderData HdrData;
DataExtractor AccelSection;
DataExtractor StringSection;
const RelocAddrMap& Relocs;
public:
DWARFAcceleratorTable(DataExtractor AccelSection, DataExtractor StringSection,
const RelocAddrMap &Relocs)
: AccelSection(AccelSection), StringSection(StringSection), Relocs(Relocs) {}
bool extract();
void dump(raw_ostream &OS);
};
}