9#ifndef LLVM_DEBUGINFO_DWARF_DWARFDEBUGFRAME_H
10#define LLVM_DEBUGINFO_DWARF_DWARFDEBUGFRAME_H
65 CFIs(CodeAlign, DataAlign, Arch) {}
121 int64_t DataAlignmentFactor,
uint64_t ReturnAddressRegister,
123 uint32_t LSDAPointerEncoding, std::optional<uint64_t> Personality,
126 DataAlignmentFactor, Arch),
127 Version(Version), Augmentation(
std::
move(Augmentation)),
128 AddressSize(AddressSize), SegmentDescriptorSize(SegmentDescriptorSize),
129 CodeAlignmentFactor(CodeAlignmentFactor),
130 DataAlignmentFactor(DataAlignmentFactor),
131 ReturnAddressRegister(ReturnAddressRegister),
132 AugmentationData(
std::
move(AugmentationData)),
133 FDEPointerEncoding(FDEPointerEncoding),
134 LSDAPointerEncoding(LSDAPointerEncoding), Personality(Personality),
135 PersonalityEnc(PersonalityEnc) {}
146 return PersonalityEnc;
162 const uint8_t SegmentDescriptorSize;
164 const int64_t DataAlignmentFactor;
165 const uint64_t ReturnAddressRegister;
171 const std::optional<uint64_t> Personality;
172 const std::optional<uint32_t> PersonalityEnc;
182 Cie ? Cie->getCodeAlignmentFactor() : 0,
184 CIEPointer(CIEPointer), InitialLocation(InitialLocation),
185 AddressRange(AddressRange), LinkedCIE(Cie), LSDAAddress(LSDAAddress) {}
207 const CIE *LinkedCIE;
208 const std::optional<uint64_t> LSDAAddress;
221 std::vector<std::unique_ptr<dwarf::FrameEntry>> Entries;
226 std::optional<DWARFDataExtractor> Data;
247 std::optional<uint64_t>
Offset)
const;
265 bool empty()
const {
return Entries.empty(); }
268 iterator
begin()
const {
return Entries.begin(); }
269 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.
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.