10 #ifndef LLVM_DEBUGINFO_DWARF_DWARFCONTEXT_H 11 #define LLVM_DEBUGINFO_DWARF_DWARFCONTEXT_H 61 std::deque<DWARFUnitSection<DWARFTypeUnit>> TUs;
62 std::unique_ptr<DWARFUnitIndex> CUIndex;
63 std::unique_ptr<DWARFGdbIndex> GdbIndex;
64 std::unique_ptr<DWARFUnitIndex> TUIndex;
65 std::unique_ptr<DWARFDebugAbbrev> Abbrev;
66 std::unique_ptr<DWARFDebugLoc> Loc;
67 std::unique_ptr<DWARFDebugAranges> Aranges;
68 std::unique_ptr<DWARFDebugLine> Line;
69 std::unique_ptr<DWARFDebugFrame> DebugFrame;
70 std::unique_ptr<DWARFDebugFrame> EHFrame;
71 std::unique_ptr<DWARFDebugMacro>
Macro;
72 std::unique_ptr<DWARFDebugNames> Names;
73 std::unique_ptr<AppleAcceleratorTable> AppleNames;
74 std::unique_ptr<AppleAcceleratorTable> AppleTypes;
75 std::unique_ptr<AppleAcceleratorTable> AppleNamespaces;
76 std::unique_ptr<AppleAcceleratorTable> AppleObjC;
79 std::deque<DWARFUnitSection<DWARFTypeUnit>> DWOTUs;
80 std::unique_ptr<DWARFDebugAbbrev> AbbrevDWO;
81 std::unique_ptr<DWARFDebugLocDWO> LocDWO;
84 unsigned MaxVersion = 0;
88 std::unique_ptr<DWARFContext>
Context;
91 std::weak_ptr<DWOFile> DWP;
92 bool CheckedForDWP =
false;
95 std::unique_ptr<MCRegisterInfo> RegInfo;
99 void parseCompileUnits();
103 void parseTypeUnits();
107 void parseDWOCompileUnits();
111 void parseDWOTypeUnits();
114 std::unique_ptr<const DWARFObject>
DObj;
118 std::string DWPName =
"");
127 return DICtx->
getKind() == CK_DWARF;
137 dump(OS, DumpOpts, DumpOffsets);
160 parseDWOCompileUnits();
184 parseDWOCompileUnits();
185 return DWOCUs.
size();
191 return DWOTUs.size();
197 return CUs[index].get();
202 parseDWOCompileUnits();
203 return DWOCUs[index].get();
217 if (Version > MaxVersion)
278 return DataExtractor(DObj->getLineStringSection(),
false, 0);
286 explicit operator bool()
const {
return CompileUnit !=
nullptr; }
293 DILineInfo getLineInfoForAddress(uint64_t Address,
302 return version == 2 || version == 3 || version == 4 || version == 5;
305 std::shared_ptr<DWARFContext> getDWOContext(
StringRef AbsolutePath);
312 static std::unique_ptr<DWARFContext>
315 std::string DWPName =
"");
317 static std::unique_ptr<DWARFContext>
318 create(
const StringMap<std::unique_ptr<MemoryBuffer>> &Sections,
328 uint8_t getCUAddrSize();
338 #endif // LLVM_DEBUGINFO_DWARF_DWARFCONTEXT_H DWARFCompileUnit * getDWOCompileUnitAtIndex(unsigned index)
Get the compile unit at the specified index for the DWO compile units.
A parsed .debug_frame or .eh_frame section.
Compute iterated dominance frontiers using a linear time algorithm.
ErrorPolicy
Used as a return value for a error callback passed to DWARF context.
This provides a very simple, boring adaptor for a begin and end iterator into a range type...
unsigned getNumDWOCompileUnits()
Get the number of compile units in the DWO context.
An efficient, type-erasing, non-owning reference to a callable.
This class is the base class for all object file types.
unsigned getNumTypeUnits()
Get the number of compile units in this context.
unsigned getMaxVersion() const
std::unique_ptr< const DWARFObject > DObj
A format-neutral container for source line information.
unsigned getNumCompileUnits()
Get the number of compile units in this context.
Tagged union holding either a T or a Error.
const MCRegisterInfo * getRegisterInfo() const
unsigned getNumDWOTypeUnits()
Get the number of compile units in the DWO context.
DataExtractor getStringExtractor() const
static const bool IsLittleEndianHost
DIContextKind getKind() const
DWARFCompileUnit * getCompileUnitAtIndex(unsigned index)
Get the compile unit at the specified index for this compile unit.
MCRegisterInfo base class - We assume that the target defines a static array of MCRegisterDesc object...
Container for dump options that control which debug information will be dumped.
Utility class that carries the DWARF compile/type unit and the debug info entry in an object...
void dump(const SparseBitVector< ElementSize > &LHS, raw_ostream &out)
This implements the Apple accelerator table format, a precursor of the DWARF 5 accelerator table form...
Controls which fields of DILineInfo container should be filled with data.
static GCRegistry::Add< CoreCLRGC > E("coreclr", "CoreCLR-compatible GC")
LLVM_ATTRIBUTE_ALWAYS_INLINE iterator begin()
A format-neutral container for inlined code description.
DataExtractor getLineStringExtractor() const
bool verify(const TargetRegisterInfo &TRI) const
Check that information hold by this instance make sense for the given TRI.
.debug_names section consists of one or more units.
const MCRegisterDesc & get(unsigned RegNo) const
Provide a get method, equivalent to [], but more useful with a pointer to this object.
void dump(raw_ostream &OS, DIDumpOptions DumpOpts) override
This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small...
Concrete instance of DWARFUnitSection, specialized for one Unit type.
DWARFContext This data structure is the top level entity that deals with dwarf debug information pars...
tu_section_iterator_range dwo_type_unit_sections()
Get type units in the DWO context.
A range adaptor for a pair of iterators.
StringMap - This is an unconventional map that is specialized for handling keys that are "strings"...
An inferface for inquiring the load address of a loaded object file to be used by the DIContext imple...
LLVM_ATTRIBUTE_ALWAYS_INLINE iterator end()
static bool isSupportedVersion(unsigned version)
Wraps the returned DIEs for a given address.
cu_iterator_range compile_units()
Get compile units in this context.
bool isLittleEndian() const
const DWARFObject & getDWARFObj() const
static bool classof(const DIContext *DICtx)
cu_iterator_range dwo_compile_units()
Get compile units in the DWO context.
constexpr char Size[]
Key for Kernel::Arg::Metadata::mSize.
Lightweight error class with error context and mandatory checking.
This class implements an extremely fast bulk output stream that can only output to a stream...
print Print MemDeps of function
StringRef - Represent a constant reference to a string, i.e.
tu_section_iterator_range type_unit_sections()
Get type units in this context.
void setMaxVersionIfGreater(unsigned Version)