2014-11-20 16:21:06 +00:00
|
|
|
//===--- DWARFAcceleratorTable.h --------------------------------*- C++ -*-===//
|
|
|
|
//
|
|
|
|
// The LLVM Compiler Infrastructure
|
|
|
|
//
|
|
|
|
// This file is distributed under the University of Illinois Open Source
|
|
|
|
// License. See LICENSE.TXT for details.
|
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
2014-11-14 16:15:53 +00:00
|
|
|
|
2014-11-14 19:30:08 +00:00
|
|
|
#include "DWARFRelocMap.h"
|
|
|
|
|
2014-11-14 16:15:53 +00:00
|
|
|
#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;
|
2014-11-20 16:21:11 +00:00
|
|
|
typedef uint16_t Form;
|
2014-11-14 16:15:53 +00:00
|
|
|
uint32_t DIEOffsetBase;
|
2014-11-20 16:21:11 +00:00
|
|
|
SmallVector<std::pair<AtomType, Form>, 3> Atoms;
|
2014-11-14 16:15:53 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
struct Header Hdr;
|
|
|
|
struct HeaderData HdrData;
|
|
|
|
DataExtractor AccelSection;
|
|
|
|
DataExtractor StringSection;
|
2014-11-14 19:30:08 +00:00
|
|
|
const RelocAddrMap& Relocs;
|
2014-11-14 16:15:53 +00:00
|
|
|
public:
|
2014-11-14 19:30:08 +00:00
|
|
|
DWARFAcceleratorTable(DataExtractor AccelSection, DataExtractor StringSection,
|
|
|
|
const RelocAddrMap &Relocs)
|
|
|
|
: AccelSection(AccelSection), StringSection(StringSection), Relocs(Relocs) {}
|
2014-11-14 16:15:53 +00:00
|
|
|
|
|
|
|
bool extract();
|
2014-11-20 16:21:11 +00:00
|
|
|
void dump(raw_ostream &OS) const;
|
2014-11-14 16:15:53 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
}
|