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) {}
365 RecordOffset(RecordOffset) {}
369 uint16_t Segment = 0;
381 RecordOffset(RecordOffset) {}
403 uint16_t
modi()
const {
return Module - 1; }
436 static constexpr
uint32_t RelocationOffset = 8;
442 RecordOffset(RecordOffset) {}
445 return RecordOffset + RelocationOffset;
450 std::vector<LocalVariableAddrGap>
Gaps;
457 static constexpr
uint32_t RelocationOffset = 12;
463 RecordOffset(RecordOffset) {}
466 return RecordOffset + RelocationOffset;
472 std::vector<LocalVariableAddrGap>
Gaps;
488 RecordOffset(RecordOffset) {}
494 std::vector<LocalVariableAddrGap>
Gaps;
512 RecordOffset(RecordOffset) {}
518 std::vector<LocalVariableAddrGap>
Gaps;
525 static constexpr
uint32_t RelocationOffset = 8;
532 RecordOffset(RecordOffset) {}
535 return RecordOffset + RelocationOffset;
540 std::vector<LocalVariableAddrGap>
Gaps;
557 RecordOffset(RecordOffset) {}
565 OffsetInParentShift = 4,
575 std::vector<LocalVariableAddrGap>
Gaps;
587 RecordOffset(RecordOffset) {}
596 static constexpr
uint32_t RelocationOffset = 16;
604 return RecordOffset + RelocationOffset;
619 static constexpr
uint32_t RelocationOffset = 4;
627 return RecordOffset + RelocationOffset;
659 RecordOffset(RecordOffset) {}
686 RecordOffset(RecordOffset) {}
702 RecordOffset(RecordOffset) {}
728 RecordOffset(RecordOffset) {}
767 RecordOffset(RecordOffset) {}
796 static constexpr
uint32_t RelocationOffset = 4;
804 return RecordOffset + RelocationOffset;
816 static constexpr
uint32_t RelocationOffset = 4;
822 RecordOffset(RecordOffset) {}
825 return RecordOffset + RelocationOffset;
838 static constexpr
uint32_t RelocationOffset = 4;
846 return RecordOffset + RelocationOffset;
876 RecordOffset(RecordOffset) {}
889 RecordOffset(RecordOffset) {}
904 RecordOffset(RecordOffset) {}
920 RecordOffset(RecordOffset) {}
931 static constexpr
uint32_t RelocationOffset = 8;
939 return RecordOffset + RelocationOffset;
952 static constexpr
uint32_t RelocationOffset = 8;
958 RecordOffset(RecordOffset) {}
961 return RecordOffset + RelocationOffset;
978 RecordOffset(RecordOffset) {}
996 #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. ...
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.
DefRangeSubfieldRegisterSym(SymbolRecordKind Kind)
UDTSym(SymbolRecordKind Kind)
BPRelativeSym(SymbolRecordKind Kind)
CompileSym3Flags getFlags() const
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)
bool operator!=(const BinaryAnnotationIterator &Other) const
ProcRefSym(uint32_t RecordOffset)
uint16_t VersionBackendMinor
ScopeEndSym(SymbolRecordKind Kind)
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)
RegisterId getParamFramePtrReg(CPUType CPU) const
Extract the register this frame uses to refer to parameters.
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
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
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
SourceLanguage getLanguage() const
bool hasOptimizations() const
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)
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
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)
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
bool empty() const
empty - Check if the array is empty.
Compile2Sym(uint32_t RecordOffset)
uint16_t VersionFrontendBuild