9 #ifndef LLVM_DEBUGINFO_CODEVIEW_SYMBOLRECORD_H 10 #define LLVM_DEBUGINFO_CODEVIEW_SYMBOLRECORD_H 43 static constexpr
uint32_t RelocationOffset = 32;
51 return RecordOffset + RelocationOffset;
114 uint8_t Alignment = 0;
170 std::forward_iterator_tag,
178 return Data == Other.Data;
187 if (!ParseCurrentAnnotation()) {
198 ParseCurrentAnnotation();
199 return Current.getValue();
204 if (Annotations.
empty())
207 uint8_t FirstByte = Annotations.
front();
210 if ((FirstByte & 0x80) == 0x00)
213 if (Annotations.
empty())
216 uint8_t SecondByte = Annotations.
front();
219 if ((FirstByte & 0xC0) == 0x80)
220 return ((FirstByte & 0x3F) << 8) | SecondByte;
222 if (Annotations.
empty())
225 uint8_t ThirdByte = Annotations.
front();
228 if (Annotations.
empty())
231 uint8_t FourthByte = Annotations.
front();
234 if ((FirstByte & 0xE0) == 0xC0)
235 return ((FirstByte & 0x1F) << 24) | (SecondByte << 16) |
236 (ThirdByte << 8) | FourthByte;
243 return -(Operand >> 1);
251 bool ParseCurrentAnnotation() {
252 if (Current.hasValue())
261 Result.
Name =
"Invalid";
265 Result.
Name =
"CodeOffset";
266 Result.
U1 = GetCompressedAnnotation(Next);
269 Result.
Name =
"ChangeCodeOffsetBase";
270 Result.
U1 = GetCompressedAnnotation(Next);
273 Result.
Name =
"ChangeCodeOffset";
274 Result.
U1 = GetCompressedAnnotation(Next);
277 Result.
Name =
"ChangeCodeLength";
278 Result.
U1 = GetCompressedAnnotation(Next);
281 Result.
Name =
"ChangeFile";
282 Result.
U1 = GetCompressedAnnotation(Next);
285 Result.
Name =
"ChangeLineEndDelta";
286 Result.
U1 = GetCompressedAnnotation(Next);
289 Result.
Name =
"ChangeRangeKind";
290 Result.
U1 = GetCompressedAnnotation(Next);
293 Result.
Name =
"ChangeColumnStart";
294 Result.
U1 = GetCompressedAnnotation(Next);
297 Result.
Name =
"ChangeColumnEnd";
298 Result.
U1 = GetCompressedAnnotation(Next);
301 Result.
Name =
"ChangeLineOffset";
305 Result.
Name =
"ChangeColumnEndDelta";
309 Result.
Name =
"ChangeCodeOffsetAndLineOffset";
310 uint32_t Annotation = GetCompressedAnnotation(Next);
312 Result.
U1 = Annotation & 0xf;
316 Result.
Name =
"ChangeCodeLengthAndCodeOffset";
317 Result.
U1 = GetCompressedAnnotation(Next);
318 Result.
U2 = GetCompressedAnnotation(Next);
338 RecordOffset(RecordOffset) {}
360 RecordOffset(RecordOffset) {}
376 RecordOffset(RecordOffset) {}
431 static constexpr
uint32_t RelocationOffset = 8;
437 RecordOffset(RecordOffset) {}
440 return RecordOffset + RelocationOffset;
445 std::vector<LocalVariableAddrGap>
Gaps;
452 static constexpr
uint32_t RelocationOffset = 12;
458 RecordOffset(RecordOffset) {}
461 return RecordOffset + RelocationOffset;
467 std::vector<LocalVariableAddrGap>
Gaps;
483 RecordOffset(RecordOffset) {}
489 std::vector<LocalVariableAddrGap>
Gaps;
507 RecordOffset(RecordOffset) {}
513 std::vector<LocalVariableAddrGap>
Gaps;
524 static constexpr
uint32_t RelocationOffset = 8;
531 RecordOffset(RecordOffset) {}
534 return RecordOffset + RelocationOffset;
539 std::vector<LocalVariableAddrGap>
Gaps;
556 RecordOffset(RecordOffset) {}
564 OffsetInParentShift = 4,
574 std::vector<LocalVariableAddrGap>
Gaps;
586 RecordOffset(RecordOffset) {}
595 static constexpr
uint32_t RelocationOffset = 16;
603 return RecordOffset + RelocationOffset;
618 static constexpr
uint32_t RelocationOffset = 4;
626 return RecordOffset + RelocationOffset;
658 RecordOffset(RecordOffset) {}
685 RecordOffset(RecordOffset) {}
701 RecordOffset(RecordOffset) {}
727 RecordOffset(RecordOffset) {}
766 RecordOffset(RecordOffset) {}
795 static constexpr
uint32_t RelocationOffset = 4;
803 return RecordOffset + RelocationOffset;
815 static constexpr
uint32_t RelocationOffset = 4;
821 RecordOffset(RecordOffset) {}
824 return RecordOffset + RelocationOffset;
837 static constexpr
uint32_t RelocationOffset = 4;
845 return RecordOffset + RelocationOffset;
875 RecordOffset(RecordOffset) {}
888 RecordOffset(RecordOffset) {}
903 RecordOffset(RecordOffset) {}
919 RecordOffset(RecordOffset) {}
930 static constexpr
uint32_t RelocationOffset = 8;
938 return RecordOffset + RelocationOffset;
951 static constexpr
uint32_t RelocationOffset = 8;
957 RecordOffset(RecordOffset) {}
960 return RecordOffset + RelocationOffset;
977 RecordOffset(RecordOffset) {}
990 RecordOffset(RecordOffset) {}
1008 #endif // LLVM_DEBUGINFO_CODEVIEW_SYMBOLRECORD_H
const T & front() const
front - Get the first element.
DefRangeFramePointerRelSym(SymbolRecordKind Kind)
uint32_t getRelocationOffset() const
SymbolRecordKind
Distinguishes individual records in the Symbols subsection of a .debug$S section. ...
This class represents lattice values for constants.
uint32_t getRelocationOffset() const
ObjNameSym(uint32_t RecordOffset)
Thunk32Sym(SymbolRecordKind Kind, uint32_t RecordOffset)
CompileSym3Flags
Corresponds to COMPILESYM3::Flags bitfield.
A Module instance is used to store all the information related to an LLVM module. ...
DefRangeSubfieldRegisterSym(SymbolRecordKind Kind)
UDTSym(SymbolRecordKind Kind)
BPRelativeSym(SymbolRecordKind Kind)
CompileSym3Flags getFlags() const
LocalSym(SymbolRecordKind Kind)
PublicSym32(SymbolRecordKind Kind)
This provides a very simple, boring adaptor for a begin and end iterator into a range type...
uint32_t getRelocationOffset() const
static DecodeStatus DecodeSignedOperand(MCInst &Inst, unsigned InsnS, uint64_t Address=0, const void *Decoder=nullptr)
UsingNamespaceSym(SymbolRecordKind Kind)
ArrayRef< uint8_t > Bytes
ProcRefSym(uint32_t RecordOffset)
ScopeEndSym(SymbolRecordKind Kind)
detail::packed_endian_specific_integral< uint16_t, little, unaligned > ulittle16_t
DefRangeRegisterHeader Hdr
BlockSym(uint32_t RecordOffset)
BinaryAnnotationsOpCode OpCode
ConstantSym(uint32_t RecordOffset)
RegRelativeSym(SymbolRecordKind Kind)
ConstantSym(SymbolRecordKind Kind)
std::vector< LocalVariableAddrGap > Gaps
EnvBlockSym(SymbolRecordKind Kind)
ArrayRef< uint8_t > VariantData
void setLanguage(SourceLanguage Lang)
UDTSym(uint32_t RecordOffset)
CallerSym(SymbolRecordKind Kind, uint32_t RecordOffset)
std::vector< LocalVariableAddrGap > Gaps
std::vector< uint8_t > AnnotationData
DefRangeRegisterSym(uint32_t RecordOffset)
RegisterId getParamFramePtrReg(CPUType CPU) const
Extract the register this frame uses to refer to parameters.
ProcRefSym(SymbolRecordKind Kind)
Tagged union holding either a T or a Error.
ThreadLocalDataSym(uint32_t RecordOffset)
DefRangeRegisterRelSym(uint32_t RecordOffset)
AnnotationSym(uint32_t RecordOffset)
LabelSym(SymbolRecordKind Kind)
uint8_t getLanguage() const
EnvBlockSym(uint32_t RecordOffset)
std::vector< StringRef > ExtraStrings
BinaryAnnotationIterator(const BinaryAnnotationIterator &Other)
PublicSymFlags
Corresponds to the CV_PUBSYMFLAGS bitfield.
CallSiteInfoSym(SymbolRecordKind Kind)
uint32_t getRelocationOffset() const
CRTP base class which implements the entire standard iterator facade in terms of a minimal subset of ...
RegisterSym(SymbolRecordKind Kind)
InlineSiteSym(uint32_t RecordOffset)
uint32_t getRelocationOffset() const
BinaryAnnotationIterator(ArrayRef< uint8_t > Annotations)
uint32_t getRelocationOffset() const
BlockSym(SymbolRecordKind Kind)
EncodedFramePtrReg
Two-bit value indicating which register is the designated frame pointer register. ...
FrameCookieSym(SymbolRecordKind Kind)
DataSym(uint32_t RecordOffset)
std::vector< LocalVariableAddrGap > Gaps
ExportSym(uint32_t RecordOffset)
detail::packed_endian_specific_integral< uint32_t, little, unaligned > ulittle32_t
FrameProcSym(SymbolRecordKind Kind)
RegRelativeSym(uint32_t RecordOffset)
HeapAllocationSiteSym(uint32_t RecordOffset)
std::vector< StringRef > Fields
LocalVariableAddrRange Range
AnnotationSym(SymbolRecordKind Kind)
LocalVariableAddrRange Range
BPRelativeSym(uint32_t RecordOffset)
DefRangeSym(uint32_t RecordOffset)
DefRangeRegisterSym(SymbolRecordKind Kind)
DataSym(SymbolRecordKind Kind)
uint32_t getFlags() const
SectionSym(SymbolRecordKind Kind, uint32_t RecordOffset)
std::vector< TypeIndex > Indices
DefRangeSubfieldRegisterHeader Hdr
LocalVariableAddrRange Range
ProcSym(SymbolRecordKind Kind, uint32_t RecordOffset)
DefRangeSym(SymbolRecordKind Kind)
std::vector< LocalVariableAddrGap > Gaps
BinaryAnnotationIterator & operator=(const BinaryAnnotationIterator Other)
PublicSym32(uint32_t RecordOffset)
BinaryAnnotationIterator & operator++()
bool hasSpilledUDTMember() const
LocalVariableAddrRange Range
const DecodedAnnotation & operator*()
ThreadLocalDataSym(SymbolRecordKind Kind)
Expected< CVSymbol > readSymbolFromStream(BinaryStreamRef Stream, uint32_t Offset)
iterator_range< T > make_range(T x, T y)
Convenience function for iterating over sub-ranges.
SourceLanguage
These values correspond to the CV_CFL_LANG enumeration, and are documented here: https://msdn.microsoft.com/en-us/library/bw3aekw6.aspx.
uint32_t getRelocationOffset() const
SymbolRecordKind getKind() const
LocalVariableAddrRange Range
BinaryStreamRef is to BinaryStream what ArrayRef is to an Array.
CPUType
These values correspond to the CV_CPU_TYPE_e enumeration, and are documented here: https://msdn...
LocalVariableAddrRange Range
static uint32_t getFlags(const Symbol *Sym)
std::vector< StringRef > Strings
TrampolineSym(SymbolRecordKind Kind, uint32_t RecordOffset)
DefRangeFramePointerRelFullScopeSym(uint32_t RecordOffset)
Compile3Sym(SymbolRecordKind Kind)
FrameProcSym(uint32_t RecordOffset)
A range adaptor for a pair of iterators.
Thunk32Sym(SymbolRecordKind Kind)
DefRangeRegisterRelHeader Hdr
FrameCookieSym(uint32_t RecordOffset)
ScopeEndSym(SymbolRecordKind Kind, uint32_t RecordOffset)
CoffGroupSym(SymbolRecordKind Kind)
bool operator==(BinaryAnnotationIterator Other) const
std::vector< LocalVariableAddrGap > Gaps
DefRangeFramePointerRelSym(uint32_t RecordOffset)
uint32_t getRelocationOffset() const
UsingNamespaceSym(uint32_t RecordOffset)
ArrayRef< T > drop_front(size_t N=1) const
Drop the first N elements of the array.
SourceLanguage getLanguage() const
bool hasOptimizations() const
LabelSym(uint32_t RecordOffset)
detail::packed_endian_specific_integral< int32_t, little, unaligned > little32_t
HeapAllocationSiteSym(SymbolRecordKind Kind)
COFFYAML::WeakExternalCharacteristics Characteristics
InlineSiteSym(SymbolRecordKind Kind)
SectionSym(SymbolRecordKind Kind)
uint32_t getRelocationOffset() const
CallerSym(SymbolRecordKind Kind)
LocalSym(uint32_t RecordOffset)
RegisterId getLocalFramePtrReg(CPUType CPU) const
Extract the register this frame uses to refer to local variables.
uint32_t getRelocationOffset() const
FileStaticSym(SymbolRecordKind Kind)
ThunkOrdinal
These values correspond to the THUNK_ORDINAL enumeration.
RegisterSym(uint32_t RecordOffset)
iterator_range< BinaryAnnotationIterator > annotations() const
DefRangeFramePointerRelHeader Hdr
CoffGroupSym(SymbolRecordKind Kind, uint32_t RecordOffset)
TrampolineSym(SymbolRecordKind Kind)
std::vector< LocalVariableAddrGap > Gaps
DefRangeFramePointerRelFullScopeSym(SymbolRecordKind Kind)
Compile3Sym(uint32_t RecordOffset)
BuildInfoSym(SymbolRecordKind Kind)
DefRangeRegisterRelSym(SymbolRecordKind Kind)
BuildInfoSym(uint32_t RecordOffset)
CallSiteInfoSym(uint32_t RecordOffset)
ObjNameSym(SymbolRecordKind Kind)
uint32_t getRelocationOffset() const
ProcSym(SymbolRecordKind Kind)
StringRef - Represent a constant reference to a string, i.e.
ProcSymFlags
Corresponds to the CV_PROCFLAGS bitfield.
LocalSymFlags
Corresponds to CV_LVARFLAGS bitfield.
CVRecord is a fat pointer (base + size pair) to a symbol or type record.
Annotations lets you mark points and ranges inside source code, for tests:
Compile2Sym(SymbolRecordKind Kind)
DefRangeSubfieldRegisterSym(uint32_t RecordOffset)
uint32_t getRelocationOffset() const
FrameCookieKind CookieKind
FileStaticSym(uint32_t RecordOffset)
DefRangeSubfieldSym(uint32_t RecordOffset)
RegisterId decodeFramePtrReg(EncodedFramePtrReg EncodedReg, CPUType CPU)
CompileSym2Flags
Corresponds to COMPILESYM2::Flags bitfield.
uint16_t offsetInParent() const
ExportSym(SymbolRecordKind Kind)
DefRangeSubfieldSym(SymbolRecordKind Kind)
SymbolRecord(SymbolRecordKind Kind)
uint32_t getRelocationOffset() const
uint32_t getRelocationOffset() const
Wrapper class representing virtual and physical registers.
bool empty() const
empty - Check if the array is empty.
Compile2Sym(uint32_t RecordOffset)