9#ifndef LLVM_DEBUGINFO_DWARF_DWARFDEBUGFRAME_H
10#define LLVM_DEBUGINFO_DWARF_DWARFDEBUGFRAME_H
66 CFIs(CodeAlign, DataAlign, Arch) {}
122 int64_t DataAlignmentFactor,
uint64_t ReturnAddressRegister,
124 uint32_t LSDAPointerEncoding, std::optional<uint64_t> Personality,
127 DataAlignmentFactor, Arch),
128 Version(Version), Augmentation(
std::
move(Augmentation)),
129 AddressSize(AddressSize), SegmentDescriptorSize(SegmentDescriptorSize),
130 CodeAlignmentFactor(CodeAlignmentFactor),
131 DataAlignmentFactor(DataAlignmentFactor),
132 ReturnAddressRegister(ReturnAddressRegister),
133 AugmentationData(
std::
move(AugmentationData)),
134 FDEPointerEncoding(FDEPointerEncoding),
135 LSDAPointerEncoding(LSDAPointerEncoding), Personality(Personality),
136 PersonalityEnc(PersonalityEnc) {}
147 return PersonalityEnc;
163 const uint8_t SegmentDescriptorSize;
165 const int64_t DataAlignmentFactor;
166 const uint64_t ReturnAddressRegister;
172 const std::optional<uint64_t> Personality;
173 const std::optional<uint32_t> PersonalityEnc;
183 Cie ? Cie->getCodeAlignmentFactor() : 0,
185 CIEPointer(CIEPointer), InitialLocation(InitialLocation),
186 AddressRange(AddressRange), LinkedCIE(Cie), LSDAAddress(LSDAAddress) {}
208 const CIE *LinkedCIE;
209 const std::optional<uint64_t> LSDAAddress;
222 std::vector<std::unique_ptr<dwarf::FrameEntry>> Entries;
227 std::optional<DWARFDataExtractor> Data;
248 std::optional<uint64_t>
Offset)
const;
266 bool empty()
const {
return Entries.empty(); }
269 iterator
begin()
const {
return Entries.begin(); }
270 iterator
end()
const {
return Entries.end(); }
static int getDataAlignmentFactor(MCStreamer &streamer)
This file defines the SmallString class.
A class that represents an address range.
iterator_range< iterator > entries() const
LLVM_ABI DWARFDebugFrame(Triple::ArchType Arch, bool IsEH=false, uint64_t EHFrameAddress=0)
LLVM_ABI void dump(raw_ostream &OS, DIDumpOptions DumpOpts, std::optional< uint64_t > Offset) const
Dump the section data into the given stream.
LLVM_ABI ~DWARFDebugFrame()
LLVM_ABI Error parse(DWARFDataExtractor Data, bool ParseCFIProgram=true)
Parse the section from raw data.
iterator begin() const
DWARF Frame entries accessors.
LLVM_ABI Error parseAllCFIPrograms() const
Decode all the CFI instruction programs that parse() was told to skip.
LLVM_ABI Error parseCFIProgram(dwarf::FrameEntry &Entry) const
Decode the CFI instruction program of Entry if parse() was told to skip it.
uint64_t getEHFrameAddress() const
bool empty() const
Return whether the section has any entries.
Lightweight error class with error context and mandatory checking.
MCRegisterInfo base class - We assume that the target defines a static array of MCRegisterDesc object...
SmallString - A SmallString is just a SmallVector with methods and accessors that make it work better...
Represent a constant reference to a string, i.e.
Represent a sequence of Call Frame Information instructions that, when read in order,...
DWARF Common Information Entry (CIE)
static bool classof(const FrameEntry *FE)
CIE(bool IsDWARF64, uint64_t Offset, uint64_t Length, uint8_t Version, SmallString< 8 > Augmentation, uint8_t AddressSize, uint8_t SegmentDescriptorSize, uint64_t CodeAlignmentFactor, int64_t DataAlignmentFactor, uint64_t ReturnAddressRegister, SmallString< 8 > AugmentationData, uint32_t FDEPointerEncoding, uint32_t LSDAPointerEncoding, std::optional< uint64_t > Personality, std::optional< uint32_t > PersonalityEnc, Triple::ArchType Arch)
uint64_t getReturnAddressRegister() const
uint8_t getVersion() const
int64_t getDataAlignmentFactor() const
std::optional< uint32_t > getPersonalityEncoding() const
std::optional< uint64_t > getPersonalityAddress() const
StringRef getAugmentationData() const
uint64_t getCodeAlignmentFactor() const
uint32_t getLSDAPointerEncoding() const
uint32_t getFDEPointerEncoding() const
StringRef getAugmentationString() const
DWARF Frame Description Entry (FDE)
uint64_t getAddressRange() const
uint64_t getInitialLocation() const
uint64_t getCIEPointer() const
std::optional< uint64_t > getLSDAAddress() const
const CIE * getLinkedCIE() const
static bool classof(const FrameEntry *FE)
FDE(bool IsDWARF64, uint64_t Offset, uint64_t Length, uint64_t CIEPointer, uint64_t InitialLocation, uint64_t AddressRange, CIE *Cie, std::optional< uint64_t > LSDAAddress, Triple::ArchType Arch)
An entry in either debug_frame or eh_frame.
FrameEntry(FrameKind K, bool IsDWARF64, uint64_t Offset, uint64_t Length, uint64_t CodeAlign, int64_t DataAlign, Triple::ArchType Arch)
const uint64_t Length
Entry length as specified in DWARF.
const uint64_t Offset
Offset of this entry in the section.
void markCFIProgramParsed()
virtual ~FrameEntry()=default
virtual void dump(raw_ostream &OS, DIDumpOptions DumpOpts) const =0
Dump the instructions in this CFI fragment.
const CFIProgram & cfis() const
FrameKind getKind() const
std::optional< uint64_t > getUnparsedCFIStartOffset() const
If using lazily parsed CFIs, this returns the section offset where the unparsed CFIs start so user ca...
uint64_t getEndOffset() const
uint64_t getLength() const
std::optional< uint64_t > UnparsedCFIStartOffset
Offset for lazy parsing; std::nullopt if CFIs are already parsed.
void markCFIProgramUnparsed(uint64_t StartOffset)
uint64_t getOffset() const
A range adaptor for a pair of iterators.
This class implements an extremely fast bulk output stream that can only output to a stream.
Calculates the starting offsets for various sections within the .debug_names section.
LLVM_ABI Expected< UnwindTable > createUnwindTable(const CIE *Cie)
Create an UnwindTable from a Common Information Entry (CIE).
This is an optimization pass for GlobalISel generic memory operations.
void dump(const SparseBitVector< ElementSize > &LHS, raw_ostream &out)
OutputIt move(R &&Range, OutputIt Out)
Provide wrappers to std::move which take ranges instead of having to pass begin/end explicitly.
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.
An iterator type that allows iterating over the pointees via some other iterator.