14#ifndef LLVM_DEBUGINFO_DICONTEXT_H
15#define LLVM_DEBUGINFO_DICONTEXT_H
36 static constexpr const char *
const BadString =
"<invalid>";
72 std::tie(
RHS.FileName,
RHS.FunctionName,
RHS.StartFileName,
RHS.Line,
73 RHS.Column,
RHS.StartLine,
RHS.Discriminator);
84 OS <<
"line " <<
Line <<
", ";
85 OS <<
"column " <<
Column <<
", ";
104 assert(Index < Frames.size());
105 return Frames[Index];
109 assert(Index < Frames.size());
110 return &Frames[Index];
117 void resize(
unsigned i) { Frames.resize(i); }
175#define HANDLE_DWARF_SECTION(ENUM_NAME, ELF_NAME, CMDLINE_NAME, OPTION) \
177#include "llvm/BinaryFormat/Dwarf.def"
178#undef HANDLE_DWARF_SECTION
182static_assert(
DIDT_ID_Count <= 32,
"section types overflow storage");
188#define HANDLE_DWARF_SECTION(ENUM_NAME, ELF_NAME, CMDLINE_NAME, OPTION) \
189 DIDT_##ENUM_NAME = 1U << DIDT_ID_##ENUM_NAME,
190#include "llvm/BinaryFormat/Dwarf.def"
191#undef HANDLE_DWARF_SECTION
270 virtual std::optional<DILineInfo>
279 virtual std::vector<DILocal>
328 virtual std::unique_ptr<LoadedObjectInfo>
clone()
const = 0;
331template <
typename Derived,
typename Base = LoadedObjectInfo>
338 template <
typename... Ts>
341 std::unique_ptr<llvm::LoadedObjectInfo>
clone()
const override {
342 return std::make_unique<Derived>(
static_cast<const Derived &
>(*
this));
assert(UImm &&(UImm !=~static_cast< T >(0)) &&"Invalid immediate!")
This file contains constants used for implementing Dwarf debug support.
This file defines the SmallVector class.
virtual std::vector< DILocal > getLocalsForAddress(object::SectionedAddress Address)=0
virtual DIInliningInfo getInliningInfoForAddress(object::SectionedAddress Address, DILineInfoSpecifier Specifier=DILineInfoSpecifier())=0
virtual DILineInfoTable getLineInfoForAddressRange(object::SectionedAddress Address, uint64_t Size, DILineInfoSpecifier Specifier=DILineInfoSpecifier())=0
virtual bool verify(raw_ostream &OS, DIDumpOptions DumpOpts={})
virtual ~DIContext()=default
virtual std::optional< DILineInfo > getLineInfoForDataAddress(object::SectionedAddress Address)=0
virtual void dump(raw_ostream &OS, DIDumpOptions DumpOpts)=0
DIContextKind getKind() const
virtual std::optional< DILineInfo > getLineInfoForAddress(object::SectionedAddress Address, DILineInfoSpecifier Specifier=DILineInfoSpecifier())=0
DIContext(DIContextKind K)
A format-neutral container for inlined code description.
const DILineInfo & getFrame(unsigned Index) const
Returns the frame at Index.
uint32_t getNumberOfFrames() const
void addFrame(const DILineInfo &Frame)
DILineInfo * getMutableFrame(unsigned Index)
Lightweight error class with error context and mandatory checking.
virtual std::unique_ptr< LoadedObjectInfo > clone() const =0
Obtain a copy of this LoadedObjectInfo.
LoadedObjectInfo(const LoadedObjectInfo &)=default
virtual bool getLoadedSectionContents(const object::SectionRef &Sec, StringRef &Data) const
If conveniently available, return the content of the given Section.
LoadedObjectInfo()=default
virtual ~LoadedObjectInfo()=default
virtual uint64_t getSectionLoadAddress(const object::SectionRef &Sec) const
Obtain the Load Address of a section by SectionRef.
This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small.
Represent a constant reference to a string, i.e.
Triple - Helper class for working with autoconf configuration names.
static LLVM_ABI void defaultWarningHandler(Error Warning)
Implement default handling for Warning.
static LLVM_ABI void defaultErrorHandler(Error Err)
Implement default handling for Error.
This is a value type class that represents a single section in the list of sections in the object fil...
This class implements an extremely fast bulk output stream that can only output to a stream.
LLVM_ABI StringRef AddressSpaceString(unsigned AS, const llvm::Triple &TT)
This is an optimization pass for GlobalISel generic memory operations.
SmallVector< std::pair< uint64_t, DILineInfo >, 16 > DILineInfoTable
DINameKind
A DINameKind is passed to name search methods to specify a preference regarding the type of name reso...
DIDumpTypeCounter
This is just a helper to programmatically construct DIDumpType.
DIDumpType
Selects which debug sections get dumped.
Implement std::hash so that hash_code can be used in STL containers.
Container for dump options that control which debug information will be dumped.
std::function< void(Error)> WarningHandler
std::function< void(Error)> RecoverableErrorHandler
static DIDumpOptions getForSingleDIE()
Return default option set for printing a single DIE without children.
llvm::SmallVector< unsigned, 0 > FilterChildTag
List of DWARF tags to filter children by.
StringRef getNameForDWARFAddressSpace(uint64_t AS) const
std::string JsonErrSummaryFile
std::function< llvm::StringRef(uint64_t DwarfRegNum, bool IsEH)> GetNameForDWARFReg
Triple TT
The target of the object being dumped.
DIDumpOptions noImplicitRecursion() const
Return the options with RecurseDepth set to 0 unless explicitly required.
unsigned ChildRecurseDepth
unsigned ParentRecurseDepth
Controls which fields of DILineInfo container should be filled with data.
DILineInfoSpecifier(FileLineInfoKind FLIKind=FileLineInfoKind::RawValue, FunctionNameKind FNKind=FunctionNameKind::None, bool ApproximateLine=false)
DINameKind FunctionNameKind
bool operator==(const DILineInfoSpecifier &RHS) const
A format-neutral container for source line information.
static constexpr const char *const BadString
void dump(raw_ostream &OS)
std::optional< uint64_t > StartAddress
bool operator!=(const DILineInfo &RHS) const
static constexpr const char *const Addr2LineBadString
static constexpr const char *const ApproxString
bool operator==(const DILineInfo &RHS) const
std::optional< StringRef > Source
bool operator<(const DILineInfo &RHS) const
std::string StartFileName
std::optional< StringRef > LineSource
std::optional< uint64_t > Size
std::optional< uint64_t > TagOffset
std::optional< int64_t > FrameOffset
LoadedObjectInfoHelper()=default
LoadedObjectInfoHelper(const LoadedObjectInfoHelper &)=default
LoadedObjectInfoHelper(Ts &&...Args)
std::unique_ptr< llvm::LoadedObjectInfo > clone() const override
Obtain a copy of this LoadedObjectInfo.