9 #ifndef LLVM_DEBUGINFO_DWARF_DWARFCONTEXT_H 10 #define LLVM_DEBUGINFO_DWARF_DWARFCONTEXT_H 60 std::unique_ptr<DWARFUnitIndex> CUIndex;
61 std::unique_ptr<DWARFGdbIndex> GdbIndex;
62 std::unique_ptr<DWARFUnitIndex> TUIndex;
63 std::unique_ptr<DWARFDebugAbbrev> Abbrev;
64 std::unique_ptr<DWARFDebugLoc> Loc;
65 std::unique_ptr<DWARFDebugAranges> Aranges;
66 std::unique_ptr<DWARFDebugLine> Line;
67 std::unique_ptr<DWARFDebugFrame> DebugFrame;
68 std::unique_ptr<DWARFDebugFrame> EHFrame;
69 std::unique_ptr<DWARFDebugMacro>
Macro;
70 std::unique_ptr<DWARFDebugNames> Names;
71 std::unique_ptr<AppleAcceleratorTable> AppleNames;
72 std::unique_ptr<AppleAcceleratorTable> AppleTypes;
73 std::unique_ptr<AppleAcceleratorTable> AppleNamespaces;
74 std::unique_ptr<AppleAcceleratorTable> AppleObjC;
77 std::unique_ptr<DWARFDebugAbbrev> AbbrevDWO;
78 std::unique_ptr<DWARFDebugMacro> MacroDWO;
81 unsigned MaxVersion = 0;
85 std::unique_ptr<DWARFContext>
Context;
88 std::weak_ptr<DWOFile> DWP;
89 bool CheckedForDWP =
false;
92 std::unique_ptr<MCRegisterInfo>
RegInfo;
97 void parseNormalUnits();
103 enum { EagerParse =
false, LazyParse =
true };
104 void parseDWOUnits(
bool Lazy =
false);
106 std::unique_ptr<const DWARFObject> DObj;
110 std::string DWPName =
"");
119 return DICtx->
getKind() == CK_DWARF;
129 dump(OS, DumpOpts, DumpOffsets);
140 NormalUnits.
begin() +
216 return NormalUnits[index].get();
222 return DWOUnits[index].get();
231 DWARFDie getDIEForOffset(uint64_t Offset);
235 info_section_units();
241 dwo_info_section_units();
246 if (Version > MaxVersion)
315 explicit operator bool()
const {
return CompileUnit !=
nullptr; }
339 return version == 2 || version == 3 || version == 4 || version == 5;
342 std::shared_ptr<DWARFContext> getDWOContext(
StringRef AbsolutePath);
349 static std::unique_ptr<DWARFContext>
352 std::string DWPName =
"");
354 static std::unique_ptr<DWARFContext>
355 create(
const StringMap<std::unique_ptr<MemoryBuffer>> &Sections,
365 uint8_t getCUAddrSize();
371 return getDWARFObj().getFile()->getArch();
381 std::vector<DILocal> &Result);
386 #endif // LLVM_DEBUGINFO_DWARF_DWARFCONTEXT_H DWARFUnit * getDWOUnitAtIndex(unsigned index)
Get the unit at the specified index for the DWO units.
unsigned getMaxDWOVersion()
unit_iterator_range dwo_type_units()
Get type units in the DWO context.
A parsed .debug_frame or .eh_frame section.
This class represents lattice values for constants.
ErrorPolicy
Used as a return value for a error callback passed to DWARF context.
Stores all information relating to a compile unit, be it in its original instance in the object file ...
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 type units in this context.
unit_iterator_range dwo_info_section_units()
Get units from .debug_info..dwo in the DWO context.
A format-neutral container for source line information.
Triple::ArchType getArch() const
unit_iterator_range normal_units()
Get all normal compile/type units in this context.
unsigned getNumCompileUnits()
Get the number of compile units in this context.
unit_iterator_range compile_units()
Get compile units in this context.
Tagged union holding either a T or a Error.
const MCRegisterInfo * getRegisterInfo() const
unsigned getNumDWOTypeUnits()
Get the number of type units in the DWO context.
DataExtractor getStringExtractor() const
static const bool IsLittleEndianHost
llvm::iterator_range< typename UnitVector::iterator > iterator_range
DIContextKind getKind() const
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.
unit_iterator_range info_section_units()
Get units from .debug_info in this context.
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...
unit_iterator_range dwo_types_section_units()
Get units from .debug_types.dwo in the DWO context.
Controls which fields of DILineInfo container should be filled with data.
Instrumentation for Order File
static GCRegistry::Add< CoreCLRGC > E("coreclr", "CoreCLR-compatible GC")
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.
unit_iterator_range dwo_compile_units()
Get compile units in the DWO context.
.debug_names section consists of one or more units.
unit_iterator_range type_units()
Get type units in this context.
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...
DWARFContext This data structure is the top level entity that deals with dwarf debug information pars...
Describe a collection of units.
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...
unit_iterator_range types_section_units()
Get units from .debug_types in this context.
static bool isSupportedVersion(unsigned version)
static DebugLoc getDebugLoc(MachineBasicBlock::instr_iterator FirstMI, MachineBasicBlock::instr_iterator LastMI)
Return the first found DebugLoc that has a DILocation, given a range of instructions.
Wraps the returned DIEs for a given address.
unit_iterator_range dwo_units()
Get all units in the DWO context.
DWARFUnit * getUnitAtIndex(unsigned index)
Get the unit at the specified index.
bool isLittleEndian() const
const DWARFObject & getDWARFObj() const
static bool classof(const DIContext *DICtx)
const MCRegisterDesc & get(MCRegister RegNo) const
Provide a get method, equivalent to [], but more useful with a pointer to this object.
unsigned getNumTypesUnits() const
Returns number of units from all .debug_types[.dwo] sections.
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...
StringRef - Represent a constant reference to a string, i.e.
void setMaxVersionIfGreater(unsigned Version)
unsigned getNumInfoUnits() const
Returns number of units from all .debug_info[.dwo] sections.