llvm-6502/lib/DebugInfo/DWARFAcceleratorTable.h
Frederic Riss 931e22fd7c [dwarfdump] Add support for dumping accelerator tables.
The class used for the dump only allows to dump for the moment, but
it can (and will) be easily extended to support search also.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@221836 91177308-0d34-0410-b5e6-96231b3b80d8
2014-11-12 23:48:10 +00:00

39 lines
792 B
C++

#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;
public:
DWARFAcceleratorTable(DataExtractor AccelSection, DataExtractor StringSection)
: AccelSection(AccelSection), StringSection(StringSection) {}
bool extract();
void dump(raw_ostream &OS);
};
}