10 #ifndef LLVM_DEBUGINFO_DWARF_DWARFCONTEXT_H 11 #define LLVM_DEBUGINFO_DWARF_DWARFCONTEXT_H 61 std::unique_ptr<DWARFUnitIndex> CUIndex;
62 std::unique_ptr<DWARFGdbIndex> GdbIndex;
63 std::unique_ptr<DWARFUnitIndex> TUIndex;
64 std::unique_ptr<DWARFDebugAbbrev> Abbrev;
65 std::unique_ptr<DWARFDebugLoc> Loc;
66 std::unique_ptr<DWARFDebugAranges> Aranges;
67 std::unique_ptr<DWARFDebugLine> Line;
68 std::unique_ptr<DWARFDebugFrame> DebugFrame;
69 std::unique_ptr<DWARFDebugFrame> EHFrame;
70 std::unique_ptr<DWARFDebugMacro>
Macro;
71 std::unique_ptr<DWARFDebugNames> Names;
72 std::unique_ptr<AppleAcceleratorTable> AppleNames;
73 std::unique_ptr<AppleAcceleratorTable> AppleTypes;
74 std::unique_ptr<AppleAcceleratorTable> AppleNamespaces;
75 std::unique_ptr<AppleAcceleratorTable> AppleObjC;
78 std::unique_ptr<DWARFDebugAbbrev> AbbrevDWO;
79 std::unique_ptr<DWARFDebugLoclists> LocDWO;
82 unsigned MaxVersion = 0;
86 std::unique_ptr<DWARFContext>
Context;
89 std::weak_ptr<DWOFile> DWP;
90 bool CheckedForDWP =
false;
93 std::unique_ptr<MCRegisterInfo> RegInfo;
98 void parseNormalUnits();
104 enum { EagerParse =
false, LazyParse =
true };
105 void parseDWOUnits(
bool Lazy =
false);
107 std::unique_ptr<const DWARFObject> DObj;
111 std::string DWPName =
"");
120 return DICtx->
getKind() == CK_DWARF;
130 dump(OS, DumpOpts, DumpOffsets);
141 NormalUnits.
begin() +
217 return NormalUnits[index].get();
223 return DWOUnits[index].get();
236 info_section_units();
242 dwo_info_section_units();
247 if (Version > MaxVersion)
308 return DataExtractor(DObj->getLineStringSection(),
false, 0);
316 explicit operator bool()
const {
return CompileUnit !=
nullptr; }
323 DILineInfo getLineInfoForAddress(uint64_t Address,
332 return version == 2 || version == 3 || version == 4 || version == 5;
335 std::shared_ptr<DWARFContext> getDWOContext(
StringRef AbsolutePath);
342 static std::unique_ptr<DWARFContext>
345 std::string DWPName =
"");
347 static std::unique_ptr<DWARFContext>
348 create(
const StringMap<std::unique_ptr<MemoryBuffer>> &Sections,
358 uint8_t getCUAddrSize();
364 return getDWARFObj().getFile()->getArch();
375 #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.
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.
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.
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.
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...
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.
LLVM_ATTRIBUTE_ALWAYS_INLINE iterator end()
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)
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...
print Print MemDeps of function
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.