2011-09-14 03:42:23 +08:00
|
|
|
//===-- DWARFDebugAbbrev.h --------------------------------------*- C++ -*-===//
|
|
|
|
//
|
|
|
|
// The LLVM Compiler Infrastructure
|
|
|
|
//
|
|
|
|
// This file is distributed under the University of Illinois Open Source
|
|
|
|
// License. See LICENSE.TXT for details.
|
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
2014-08-14 00:26:38 +08:00
|
|
|
#ifndef LLVM_LIB_DEBUGINFO_DWARFDEBUGABBREV_H
|
|
|
|
#define LLVM_LIB_DEBUGINFO_DWARFDEBUGABBREV_H
|
2011-09-14 03:42:23 +08:00
|
|
|
|
|
|
|
#include "DWARFAbbreviationDeclaration.h"
|
|
|
|
#include <list>
|
|
|
|
#include <map>
|
|
|
|
#include <vector>
|
|
|
|
|
|
|
|
namespace llvm {
|
|
|
|
|
|
|
|
class DWARFAbbreviationDeclarationSet {
|
2011-11-06 00:01:13 +08:00
|
|
|
uint32_t Offset;
|
2014-04-26 05:10:56 +08:00
|
|
|
/// Code of the first abbreviation, if all abbreviations in the set have
|
|
|
|
/// consecutive codes. UINT32_MAX otherwise.
|
|
|
|
uint32_t FirstAbbrCode;
|
2011-09-14 03:42:23 +08:00
|
|
|
std::vector<DWARFAbbreviationDeclaration> Decls;
|
|
|
|
|
2014-04-26 05:10:56 +08:00
|
|
|
public:
|
|
|
|
DWARFAbbreviationDeclarationSet();
|
2011-09-14 03:42:23 +08:00
|
|
|
|
2011-11-06 00:01:13 +08:00
|
|
|
uint32_t getOffset() const { return Offset; }
|
2011-09-14 03:42:23 +08:00
|
|
|
void dump(raw_ostream &OS) const;
|
2014-04-26 05:10:56 +08:00
|
|
|
bool extract(DataExtractor Data, uint32_t *OffsetPtr);
|
2011-09-14 03:42:23 +08:00
|
|
|
|
|
|
|
const DWARFAbbreviationDeclaration *
|
2014-04-26 05:10:56 +08:00
|
|
|
getAbbreviationDeclaration(uint32_t AbbrCode) const;
|
|
|
|
|
|
|
|
private:
|
|
|
|
void clear();
|
2011-09-14 03:42:23 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
class DWARFDebugAbbrev {
|
2011-09-14 05:47:32 +08:00
|
|
|
typedef std::map<uint64_t, DWARFAbbreviationDeclarationSet>
|
2014-04-26 05:10:56 +08:00
|
|
|
DWARFAbbreviationDeclarationSetMap;
|
2011-09-14 05:47:32 +08:00
|
|
|
|
2014-04-26 05:10:56 +08:00
|
|
|
DWARFAbbreviationDeclarationSetMap AbbrDeclSets;
|
|
|
|
mutable DWARFAbbreviationDeclarationSetMap::const_iterator PrevAbbrOffsetPos;
|
2011-09-14 05:47:32 +08:00
|
|
|
|
2011-09-14 03:42:23 +08:00
|
|
|
public:
|
|
|
|
DWARFDebugAbbrev();
|
2014-04-25 06:41:09 +08:00
|
|
|
|
2011-09-14 03:42:23 +08:00
|
|
|
const DWARFAbbreviationDeclarationSet *
|
2014-04-25 06:41:09 +08:00
|
|
|
getAbbreviationDeclarationSet(uint64_t CUAbbrOffset) const;
|
|
|
|
|
2011-09-14 03:42:23 +08:00
|
|
|
void dump(raw_ostream &OS) const;
|
2014-04-26 05:10:56 +08:00
|
|
|
void extract(DataExtractor Data);
|
|
|
|
|
|
|
|
private:
|
|
|
|
void clear();
|
2011-09-14 03:42:23 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|