LLVM: include/llvm/DebugInfo/DWARF/DWARFDebugFrame.h Source File (original) (raw)
1
2
3
4
5
6
7
8
9#ifndef LLVM_DEBUGINFO_DWARF_DWARFDEBUGFRAME_H
10#define LLVM_DEBUGINFO_DWARF_DWARFDEBUGFRAME_H
11
20#include
21#include
22
23namespace llvm {
24
29
31
33
34
35
36
37
38
39
40
41
43
45
46
47
48
49
50
51
52
53
55
56
57
59public:
61
65 CFIs(CodeAlign, DataAlign, Arch) {}
66
68
74
75
77
78protected:
80
82
83
85
86
88
90};
91
92
94public:
95
96
99 uint8_t SegmentDescriptorSize, uint64_t CodeAlignmentFactor,
100 int64_t DataAlignmentFactor, uint64_t ReturnAddressRegister,
102 uint32_t LSDAPointerEncoding, std::optional<uint64_t> Personality,
103 std::optional<uint32_t> PersonalityEnc, Triple::ArchType Arch)
105 DataAlignmentFactor, Arch),
106 Version(Version), Augmentation(std::move(Augmentation)),
107 AddressSize(AddressSize), SegmentDescriptorSize(SegmentDescriptorSize),
108 CodeAlignmentFactor(CodeAlignmentFactor),
109 DataAlignmentFactor(DataAlignmentFactor),
110 ReturnAddressRegister(ReturnAddressRegister),
111 AugmentationData(std::move(AugmentationData)),
112 FDEPointerEncoding(FDEPointerEncoding),
113 LSDAPointerEncoding(LSDAPointerEncoding), Personality(Personality),
114 PersonalityEnc(PersonalityEnc) {}
115
117
125 return PersonalityEnc;
126 }
127
129
131
133
135
136private:
137
140 const uint8_t AddressSize;
141 const uint8_t SegmentDescriptorSize;
142 const uint64_t CodeAlignmentFactor;
143 const int64_t DataAlignmentFactor;
144 const uint64_t ReturnAddressRegister;
145
146
148 const uint32_t FDEPointerEncoding;
149 const uint32_t LSDAPointerEncoding;
150 const std::optional<uint64_t> Personality;
151 const std::optional<uint32_t> PersonalityEnc;
152};
153
154
156public:
161 Cie ? Cie->getCodeAlignmentFactor() : 0,
163 CIEPointer(CIEPointer), InitialLocation(InitialLocation),
164 AddressRange(AddressRange), LinkedCIE(Cie), LSDAAddress(LSDAAddress) {}
165
166 ~FDE() override = default;
167
172 std::optional<uint64_t> getLSDAAddress() const { return LSDAAddress; }
173
175
177
178private:
179
180
181
182
184 const uint64_t InitialLocation;
186 const CIE *LinkedCIE;
187 const std::optional<uint64_t> LSDAAddress;
188};
189
190}
191
192
195
196 const bool IsEH;
197
198 const uint64_t EHFrameAddress;
199
200 std::vector<std::unique_ptrdwarf::FrameEntry> Entries;
202
203
205
206public:
207
208
209
210
212 uint64_t EHFrameAddress = 0);
214
215
217 std::optional<uint64_t> Offset) const;
218
219
220
222
223
224 bool empty() const { return Entries.empty(); }
225
226
227 iterator begin() const { return Entries.begin(); }
228 iterator end() const { return Entries.end(); }
230
232};
233
234}
235
236#endif
static int getDataAlignmentFactor(MCStreamer &streamer)
This file defines the SmallString class.
A class that represents an address range.
iterator end() const
Definition DWARFDebugFrame.h:228
iterator_range< iterator > entries() const
Definition DWARFDebugFrame.h:229
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)
Parse the section from raw data.
iterator begin() const
DWARF Frame entries accessors.
Definition DWARFDebugFrame.h:227
uint64_t getEHFrameAddress() const
Definition DWARFDebugFrame.h:231
bool empty() const
Return whether the section has any entries.
Definition DWARFDebugFrame.h:224
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...
StringRef - 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)
Definition DWARFDebugFrame.h:93
static bool classof(const FrameEntry *FE)
Definition DWARFDebugFrame.h:116
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)
Definition DWARFDebugFrame.h:97
uint64_t getReturnAddressRegister() const
Definition DWARFDebugFrame.h:122
uint8_t getVersion() const
Definition DWARFDebugFrame.h:121
int64_t getDataAlignmentFactor() const
Definition DWARFDebugFrame.h:120
std::optional< uint32_t > getPersonalityEncoding() const
Definition DWARFDebugFrame.h:124
std::optional< uint64_t > getPersonalityAddress() const
Definition DWARFDebugFrame.h:123
StringRef getAugmentationData() const
Definition DWARFDebugFrame.h:128
uint64_t getCodeAlignmentFactor() const
Definition DWARFDebugFrame.h:119
uint32_t getLSDAPointerEncoding() const
Definition DWARFDebugFrame.h:132
uint32_t getFDEPointerEncoding() const
Definition DWARFDebugFrame.h:130
StringRef getAugmentationString() const
Definition DWARFDebugFrame.h:118
DWARF Frame Description Entry (FDE)
Definition DWARFDebugFrame.h:155
uint64_t getAddressRange() const
Definition DWARFDebugFrame.h:171
uint64_t getInitialLocation() const
Definition DWARFDebugFrame.h:170
uint64_t getCIEPointer() const
Definition DWARFDebugFrame.h:169
std::optional< uint64_t > getLSDAAddress() const
Definition DWARFDebugFrame.h:172
const CIE * getLinkedCIE() const
Definition DWARFDebugFrame.h:168
static bool classof(const FrameEntry *FE)
Definition DWARFDebugFrame.h:176
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)
Definition DWARFDebugFrame.h:157
An entry in either debug_frame or eh_frame.
Definition DWARFDebugFrame.h:58
FrameEntry(FrameKind K, bool IsDWARF64, uint64_t Offset, uint64_t Length, uint64_t CodeAlign, int64_t DataAlign, Triple::ArchType Arch)
Definition DWARFDebugFrame.h:62
const uint64_t Length
Entry length as specified in DWARF.
Definition DWARFDebugFrame.h:87
const uint64_t Offset
Offset of this entry in the section.
Definition DWARFDebugFrame.h:84
virtual ~FrameEntry()=default
virtual void dump(raw_ostream &OS, DIDumpOptions DumpOpts) const =0
Dump the instructions in this CFI fragment.
const CFIProgram & cfis() const
Definition DWARFDebugFrame.h:72
CFIProgram CFIs
Definition DWARFDebugFrame.h:89
CFIProgram & cfis()
Definition DWARFDebugFrame.h:73
const FrameKind Kind
Definition DWARFDebugFrame.h:79
FrameKind getKind() const
Definition DWARFDebugFrame.h:69
const bool IsDWARF64
Definition DWARFDebugFrame.h:81
uint64_t getLength() const
Definition DWARFDebugFrame.h:71
uint64_t getOffset() const
Definition DWARFDebugFrame.h:70
FrameKind
Definition DWARFDebugFrame.h:60
@ FK_CIE
Definition DWARFDebugFrame.h:60
@ FK_FDE
Definition DWARFDebugFrame.h:60
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)
FunctionAddr VTableAddr uintptr_t uintptr_t Version
FunctionAddr VTableAddr uintptr_t uintptr_t Data
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.