10 #ifndef LLVM_DEBUGINFO_DWARF_DWARFDEBUGFRAME_H 11 #define LLVM_DEBUGINFO_DWARF_DWARFDEBUGFRAME_H 59 unsigned size()
const {
return (
unsigned)Instructions.size(); }
60 bool empty()
const {
return Instructions.empty(); }
62 CFIProgram(uint64_t CodeAlignmentFactor, int64_t DataAlignmentFactor)
63 : CodeAlignmentFactor(CodeAlignmentFactor),
64 DataAlignmentFactor(DataAlignmentFactor) {}
73 unsigned IndentLevel = 1)
const;
76 std::vector<Instruction> Instructions;
77 const uint64_t CodeAlignmentFactor;
78 const int64_t DataAlignmentFactor;
81 void addInstruction(uint8_t
Opcode) {
86 void addInstruction(uint8_t Opcode, uint64_t Operand1) {
88 Instructions.back().Ops.push_back(Operand1);
92 void addInstruction(uint8_t Opcode, uint64_t Operand1, uint64_t Operand2) {
94 Instructions.back().Ops.push_back(Operand1);
95 Instructions.back().Ops.push_back(Operand2);
109 OT_FactoredCodeOffset,
110 OT_SignedFactDataOffset,
111 OT_UnsignedFactDataOffset,
123 uint64_t Operand)
const;
134 :
Kind(K), Offset(Offset), Length(Length), CFIs(CodeAlign, DataAlign) {}
146 bool IsEH)
const = 0;
167 uint8_t SegmentDescriptorSize, uint64_t CodeAlignmentFactor,
168 int64_t DataAlignmentFactor, uint64_t ReturnAddressRegister,
172 :
FrameEntry(FK_CIE, Offset, Length, CodeAlignmentFactor,
173 DataAlignmentFactor),
174 Version(Version), Augmentation(
std::move(Augmentation)),
175 AddressSize(AddressSize), SegmentDescriptorSize(SegmentDescriptorSize),
176 CodeAlignmentFactor(CodeAlignmentFactor),
177 DataAlignmentFactor(DataAlignmentFactor),
178 ReturnAddressRegister(ReturnAddressRegister),
179 AugmentationData(
std::move(AugmentationData)),
180 FDEPointerEncoding(FDEPointerEncoding),
181 LSDAPointerEncoding(LSDAPointerEncoding), Personality(Personality),
182 PersonalityEnc(PersonalityEnc) {}
199 bool IsEH)
const override;
205 const uint8_t AddressSize;
206 const uint8_t SegmentDescriptorSize;
207 const uint64_t CodeAlignmentFactor;
208 const int64_t DataAlignmentFactor;
209 const uint64_t ReturnAddressRegister;
225 FDE(uint64_t
Offset, uint64_t Length, int64_t LinkedCIEOffset,
226 uint64_t InitialLocation, uint64_t AddressRange,
CIE *Cie,
229 Cie ? Cie->getCodeAlignmentFactor() : 0,
231 LinkedCIEOffset(LinkedCIEOffset), InitialLocation(InitialLocation),
232 AddressRange(AddressRange), LinkedCIE(Cie), LSDAAddress(LSDAAddress) {}
234 ~
FDE()
override =
default;
242 bool IsEH)
const override;
248 const uint64_t LinkedCIEOffset;
249 const uint64_t InitialLocation;
250 const uint64_t AddressRange;
251 const CIE *LinkedCIE;
262 const uint64_t EHFrameAddress;
264 std::vector<std::unique_ptr<dwarf::FrameEntry>> Entries;
287 bool empty()
const {
return Entries.empty(); }
301 #endif // LLVM_DEBUGINFO_DWARF_DWARFDEBUGFRAME_H int64_t getDataAlignmentFactor() const
iterator_range< iterator > entries() const
static int getDataAlignmentFactor(MCStreamer &streamer)
InstrList::iterator iterator
iterator begin() const
DWARF Frame entries accessors.
InstrList::const_iterator const_iterator
static bool classof(const FrameEntry *FE)
A parsed .debug_frame or .eh_frame section.
Compute iterated dominance frontiers using a linear time algorithm.
Optional< uint64_t > getPersonalityAddress() const
Error parse(DataExtractor Data, uint32_t *Offset, uint32_t EndOffset)
Parse and store a sequence of CFI instructions from Data, starting at *Offset and ending at EndOffset...
An entry in either debug_frame or eh_frame.
uint8_t getVersion() const
uint64_t getEHFrameAddress() const
uint32_t getLSDAPointerEncoding() const
uint64_t getCodeAlignmentFactor() const
uint64_t getInitialLocation() const
CFIProgram(uint64_t CodeAlignmentFactor, int64_t DataAlignmentFactor)
Instruction(uint8_t Opcode)
ArrayRef - Represent a constant reference to an array (0 or more elements consecutively in memory)...
FDE(uint64_t Offset, uint64_t Length, int64_t LinkedCIEOffset, uint64_t InitialLocation, uint64_t AddressRange, CIE *Cie, Optional< uint64_t > LSDAAddress)
MCRegisterInfo base class - We assume that the target defines a static array of MCRegisterDesc object...
unsigned const MachineRegisterInfo * MRI
DWARF Frame Description Entry (FDE)
uint32_t getFDEPointerEncoding() const
const uint64_t Offset
Offset of this entry in the section.
uint64_t getLength() const
Represent a sequence of Call Frame Information instructions that, when read in order, construct a table mapping PC to frame state.
static bool classof(const FrameEntry *FE)
void dump(raw_ostream &OS, const MCRegisterInfo *MRI, bool IsEH, unsigned IndentLevel=1) const
const CIE * getLinkedCIE() const
Optional< uint32_t > getPersonalityEncoding() const
std::vector< Instruction > InstrList
bool empty() const
Return whether the section has any entries.
An iterator type that allows iterating over the pointees via some other iterator. ...
FrameEntry(FrameKind K, uint64_t Offset, uint64_t Length, uint64_t CodeAlign, int64_t DataAlign)
DWARF Common Information Entry (CIE)
SmallVector< uint64_t, 2 > Operands
A range adaptor for a pair of iterators.
const_iterator end() const
const CFIProgram & cfis() const
StringRef getAugmentationString() const
const uint64_t Length
Entry length as specified in DWARF.
FrameKind getKind() const
Optional< uint64_t > getLSDAAddress() const
An instruction consists of a DWARF CFI opcode and an optional sequence of operands.
uint64_t getOffset() const
const_iterator begin() const
Lightweight error class with error context and mandatory checking.
Optional< DWARFExpression > Expression
This class implements an extremely fast bulk output stream that can only output to a stream...
CIE(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, Optional< uint64_t > Personality, Optional< uint32_t > PersonalityEnc)
StringRef - Represent a constant reference to a string, i.e.
uint64_t getReturnAddressRegister() const
uint64_t getAddressRange() const