10 #ifndef LLVM_DEBUGINFO_CODEVIEW_SYMBOLRECORD_H 11 #define LLVM_DEBUGINFO_CODEVIEW_SYMBOLRECORD_H 43 static constexpr
uint32_t RelocationOffset = 32;
51 return RecordOffset + RelocationOffset;
174 return Data == Other.Data;
178 return !(*
this ==
Other);
187 if (!ParseCurrentAnnotation()) {
204 ParseCurrentAnnotation();
205 return Current.getValue();
210 if (Annotations.
empty())
213 uint8_t FirstByte = Annotations.
front();
216 if ((FirstByte & 0x80) == 0x00)
219 if (Annotations.
empty())
222 uint8_t SecondByte = Annotations.
front();
225 if ((FirstByte & 0xC0) == 0x80)
226 return ((FirstByte & 0x3F) << 8) | SecondByte;
228 if (Annotations.
empty())
231 uint8_t ThirdByte = Annotations.
front();
234 if (Annotations.
empty())
237 uint8_t FourthByte = Annotations.
front();
240 if ((FirstByte & 0xE0) == 0xC0)
241 return ((FirstByte & 0x1F) << 24) | (SecondByte << 16) |
242 (ThirdByte << 8) | FourthByte;
249 return -(Operand >> 1);
257 bool ParseCurrentAnnotation() {
258 if (Current.hasValue())
267 Result.
Name =
"Invalid";
271 Result.
Name =
"CodeOffset";
272 Result.
U1 = GetCompressedAnnotation(Next);
275 Result.
Name =
"ChangeCodeOffsetBase";
276 Result.
U1 = GetCompressedAnnotation(Next);
279 Result.
Name =
"ChangeCodeOffset";
280 Result.
U1 = GetCompressedAnnotation(Next);
283 Result.
Name =
"ChangeCodeLength";
284 Result.
U1 = GetCompressedAnnotation(Next);
287 Result.
Name =
"ChangeFile";
288 Result.
U1 = GetCompressedAnnotation(Next);
291 Result.
Name =
"ChangeLineEndDelta";
292 Result.
U1 = GetCompressedAnnotation(Next);
295 Result.
Name =
"ChangeRangeKind";
296 Result.
U1 = GetCompressedAnnotation(Next);
299 Result.
Name =
"ChangeColumnStart";
300 Result.
U1 = GetCompressedAnnotation(Next);
303 Result.
Name =
"ChangeColumnEnd";
304 Result.
U1 = GetCompressedAnnotation(Next);
307 Result.
Name =
"ChangeLineOffset";
311 Result.
Name =
"ChangeColumnEndDelta";
315 Result.
Name =
"ChangeCodeOffsetAndLineOffset";
316 uint32_t Annotation = GetCompressedAnnotation(Next);
318 Result.
U1 = Annotation & 0xf;
322 Result.
Name =
"ChangeCodeLengthAndCodeOffset";
323 Result.
U1 = GetCompressedAnnotation(Next);
324 Result.
U2 = GetCompressedAnnotation(Next);
343 RecordOffset(RecordOffset) {}
364 RecordOffset(RecordOffset) {}
368 uint16_t Segment = 0;
380 RecordOffset(RecordOffset) {}
434 static constexpr
uint32_t RelocationOffset = 8;
440 RecordOffset(RecordOffset) {}
443 return RecordOffset + RelocationOffset;
448 std::vector<LocalVariableAddrGap>
Gaps;
455 static constexpr
uint32_t RelocationOffset = 12;
461 RecordOffset(RecordOffset) {}
464 return RecordOffset + RelocationOffset;
470 std::vector<LocalVariableAddrGap>
Gaps;
486 RecordOffset(RecordOffset) {}
492 std::vector<LocalVariableAddrGap>
Gaps;
510 RecordOffset(RecordOffset) {}
516 std::vector<LocalVariableAddrGap>
Gaps;
523 static constexpr
uint32_t RelocationOffset = 8;
530 RecordOffset(RecordOffset) {}
533 return RecordOffset + RelocationOffset;
538 std::vector<LocalVariableAddrGap>
Gaps;
555 RecordOffset(RecordOffset) {}
563 OffsetInParentShift = 4,
573 std::vector<LocalVariableAddrGap>
Gaps;
585 RecordOffset(RecordOffset) {}
594 static constexpr
uint32_t RelocationOffset = 16;
602 return RecordOffset + RelocationOffset;
617 static constexpr
uint32_t RelocationOffset = 4;
625 return RecordOffset + RelocationOffset;
656 RecordOffset(RecordOffset) {}
683 RecordOffset(RecordOffset) {}
699 RecordOffset(RecordOffset) {}
724 RecordOffset(RecordOffset) {}
754 RecordOffset(RecordOffset) {}
769 static constexpr
uint32_t RelocationOffset = 4;
777 return RecordOffset + RelocationOffset;
789 static constexpr
uint32_t RelocationOffset = 4;
795 RecordOffset(RecordOffset) {}
798 return RecordOffset + RelocationOffset;
811 static constexpr
uint32_t RelocationOffset = 4;
819 return RecordOffset + RelocationOffset;
849 RecordOffset(RecordOffset) {}
862 RecordOffset(RecordOffset) {}
877 RecordOffset(RecordOffset) {}
893 RecordOffset(RecordOffset) {}
904 static constexpr
uint32_t RelocationOffset = 8;
912 return RecordOffset + RelocationOffset;
925 static constexpr
uint32_t RelocationOffset = 8;
931 RecordOffset(RecordOffset) {}
934 return RecordOffset + RelocationOffset;
951 RecordOffset(RecordOffset) {}
969 #endif // LLVM_DEBUGINFO_CODEVIEW_SYMBOLRECORD_H
const T & front() const
front - Get the first element.
DefRangeFramePointerRelSym(SymbolRecordKind Kind)
uint32_t ModFilenameOffset
uint32_t getRelocationOffset() const
uint32_t OffsetOfExceptionHandler
SymbolRecordKind
Distinguishes individual records in the Symbols subsection of a .debug$S section. ...
Compute iterated dominance frontiers using a linear time algorithm.
uint32_t getRelocationOffset() const
ObjNameSym(uint32_t RecordOffset)
Thunk32Sym(SymbolRecordKind Kind, uint32_t RecordOffset)
CompileSym3Flags
Corresponds to COMPILESYM3::Flags bitfield.
DefRangeSubfieldRegisterSym(SymbolRecordKind Kind)
UDTSym(SymbolRecordKind Kind)
BPRelativeSym(SymbolRecordKind Kind)
LocalSym(SymbolRecordKind Kind)
uint16_t SectionIdOfExceptionHandler
PublicSym32(SymbolRecordKind Kind)
FrameProcedureOptions Flags
This provides a very simple, boring adaptor for a begin and end iterator into a range type...
uint32_t BytesOfCalleeSavedRegisters
uint32_t getRelocationOffset() const
static DecodeStatus DecodeSignedOperand(MCInst &Inst, unsigned InsnS, uint64_t Address=0, const void *Decoder=nullptr)
UsingNamespaceSym(SymbolRecordKind Kind)
uint8_t getLanguage() const
bool operator!=(const BinaryAnnotationIterator &Other) const
ProcRefSym(uint32_t RecordOffset)
uint16_t VersionBackendMinor
ScopeEndSym(SymbolRecordKind Kind)
uint32_t getFlags() const
detail::packed_endian_specific_integral< uint16_t, little, unaligned > ulittle16_t
BlockSym(uint32_t RecordOffset)
uint16_t VersionFrontendMajor
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)
uint16_t VersionBackendBuild
CallerSym(SymbolRecordKind Kind, uint32_t RecordOffset)
std::vector< LocalVariableAddrGap > Gaps
std::vector< uint8_t > AnnotationData
DefRangeRegisterSym(uint32_t RecordOffset)
uint16_t VersionFrontendMajor
uint16_t VersionFrontendQFE
ProcRefSym(SymbolRecordKind Kind)
Tagged union holding either a T or a Error.
ThreadLocalDataSym(uint32_t RecordOffset)
DefRangeRegisterRelSym(uint32_t RecordOffset)
uint16_t VersionBackendMajor
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)
uint16_t CallInstructionSize
uint32_t getRelocationOffset() const
RegisterSym(SymbolRecordKind Kind)
InlineSiteSym(uint32_t RecordOffset)
uint32_t getRelocationOffset() const
BinaryAnnotationIterator(ArrayRef< uint8_t > Annotations)
uint32_t getRelocationOffset() const
BlockSym(SymbolRecordKind Kind)
uint16_t VersionFrontendBuild
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
LocalVariableAddrRange Range
BPRelativeSym(uint32_t RecordOffset)
DefRangeSym(uint32_t RecordOffset)
DefRangeRegisterSym(SymbolRecordKind Kind)
BinaryAnnotationIterator operator++(int)
DataSym(SymbolRecordKind Kind)
uint32_t getFlags() const
uint16_t VersionBackendMajor
SectionSym(SymbolRecordKind Kind, uint32_t RecordOffset)
std::vector< TypeIndex > Indices
BinaryAnnotationsOpCode OpCode
const AnnotationData & operator*()
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
uint16_t VersionFrontendMinor
uint16_t VersionFrontendMinor
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
uint16_t VersionBackendMinor
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
TrampolineSym(SymbolRecordKind Kind, uint32_t RecordOffset)
DefRangeFramePointerRelFullScopeSym(uint32_t RecordOffset)
Compile3Sym(SymbolRecordKind Kind)
uint32_t PaddingFrameBytes
FrameProcSym(uint32_t RecordOffset)
A range adaptor for a pair of iterators.
Thunk32Sym(SymbolRecordKind Kind)
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.
uint16_t VersionBackendBuild
LabelSym(uint32_t RecordOffset)
detail::packed_endian_specific_integral< int32_t, little, unaligned > little32_t
HeapAllocationSiteSym(SymbolRecordKind Kind)
InlineSiteSym(SymbolRecordKind Kind)
SectionSym(SymbolRecordKind Kind)
uint32_t getRelocationOffset() const
CallerSym(SymbolRecordKind Kind)
LocalSym(uint32_t RecordOffset)
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
CoffGroupSym(SymbolRecordKind Kind, uint32_t RecordOffset)
TrampolineSym(SymbolRecordKind Kind)
std::vector< LocalVariableAddrGap > Gaps
uint16_t VersionBackendQFE
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.
Compile2Sym(SymbolRecordKind Kind)
DefRangeSubfieldRegisterSym(uint32_t RecordOffset)
uint32_t getRelocationOffset() const
FrameCookieKind CookieKind
FileStaticSym(uint32_t RecordOffset)
DefRangeSubfieldSym(uint32_t RecordOffset)
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
bool empty() const
empty - Check if the array is empty.
Compile2Sym(uint32_t RecordOffset)
uint16_t VersionFrontendBuild