Go to the documentation of this file.
9 #ifndef LLVM_DEBUGINFO_CODEVIEW_SYMBOLRECORD_H
10 #define LLVM_DEBUGINFO_CODEVIEW_SYMBOLRECORD_H
43 static constexpr
uint32_t RelocationOffset = 32;
170 std::forward_iterator_tag,
175 : Data(
Other.Data) {}
178 return Data ==
Other.Data;
187 if (!ParseCurrentAnnotation()) {
198 ParseCurrentAnnotation();
210 if ((FirstByte & 0x80) == 0x00)
219 if ((FirstByte & 0xC0) == 0x80)
220 return ((FirstByte & 0x3F) << 8) | SecondByte;
234 if ((FirstByte & 0xE0) == 0xC0)
235 return ((FirstByte & 0x1F) << 24) | (SecondByte << 16) |
236 (ThirdByte << 8) | FourthByte;
241 static int32_t DecodeSignedOperand(
uint32_t Operand) {
243 return -(Operand >> 1);
247 static int32_t DecodeSignedOperand(ArrayRef<uint8_t> &Annotations) {
248 return DecodeSignedOperand(GetCompressedAnnotation(Annotations));
251 bool ParseCurrentAnnotation() {
262 Next = ArrayRef<uint8_t>();
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";
302 Result.S1 = DecodeSignedOperand(Next);
305 Result.Name =
"ChangeColumnEndDelta";
306 Result.S1 = DecodeSignedOperand(Next);
309 Result.Name =
"ChangeCodeOffsetAndLineOffset";
311 Result.S1 = DecodeSignedOperand(Annotation >> 4);
316 Result.Name =
"ChangeCodeLengthAndCodeOffset";
317 Result.U1 = GetCompressedAnnotation(Next);
318 Result.U2 = GetCompressedAnnotation(Next);
327 Optional<DecodedAnnotation> Current;
328 ArrayRef<uint8_t> Data;
329 ArrayRef<uint8_t> Next;
438 static constexpr
uint32_t RelocationOffset = 8;
452 std::vector<LocalVariableAddrGap>
Gaps;
459 static constexpr
uint32_t RelocationOffset = 12;
474 std::vector<LocalVariableAddrGap>
Gaps;
496 std::vector<LocalVariableAddrGap>
Gaps;
520 std::vector<LocalVariableAddrGap>
Gaps;
531 static constexpr
uint32_t RelocationOffset = 8;
546 std::vector<LocalVariableAddrGap>
Gaps;
581 std::vector<LocalVariableAddrGap>
Gaps;
602 static constexpr
uint32_t RelocationOffset = 16;
625 static constexpr
uint32_t RelocationOffset = 4;
802 static constexpr
uint32_t RelocationOffset = 4;
822 static constexpr
uint32_t RelocationOffset = 4;
844 static constexpr
uint32_t RelocationOffset = 4;
937 static constexpr
uint32_t RelocationOffset = 8;
958 static constexpr
uint32_t RelocationOffset = 8;
1012 #endif // LLVM_DEBUGINFO_CODEVIEW_SYMBOLRECORD_H
DefRangeRegisterRelSym(uint32_t RecordOffset)
DefRangeSubfieldRegisterSym(uint32_t RecordOffset)
FrameCookieKind CookieKind
TrampolineSym(SymbolRecordKind Kind, uint32_t RecordOffset)
This is an optimization pass for GlobalISel generic memory operations.
uint16_t VersionFrontendMajor
CoffGroupSym(SymbolRecordKind Kind)
ArrayRef< uint8_t > VariantData
iterator_range< T > make_range(T x, T y)
Convenience function for iterating over sub-ranges.
uint32_t getRelocationOffset() const
DefRangeSubfieldRegisterSym(SymbolRecordKind Kind)
LocalVariableAddrRange Range
FrameProcedureOptions Flags
UsingNamespaceSym(SymbolRecordKind Kind)
FileStaticSym(uint32_t RecordOffset)
RegisterSym(SymbolRecordKind Kind)
ProcSymFlags
Corresponds to the CV_PROCFLAGS bitfield.
UsingNamespaceSym(uint32_t RecordOffset)
std::vector< LocalVariableAddrGap > Gaps
DefRangeSubfieldRegisterHeader Hdr
BinaryAnnotationIterator()=default
ConstantSym(SymbolRecordKind Kind)
ExportSym(SymbolRecordKind Kind)
CoffGroupSym(SymbolRecordKind Kind, uint32_t RecordOffset)
uint32_t getRelocationOffset() const
uint16_t VersionBackendBuild
AnnotationSym(SymbolRecordKind Kind)
UDTSym(SymbolRecordKind Kind)
CallerSym(SymbolRecordKind Kind, uint32_t RecordOffset)
ProcSym(SymbolRecordKind Kind, uint32_t RecordOffset)
DefRangeRegisterSym(SymbolRecordKind Kind)
TrampolineSym(SymbolRecordKind Kind)
SymbolRecordKind getKind() const
Tagged union holding either a T or a Error.
FrameProcSym(SymbolRecordKind Kind)
AnnotationSym(uint32_t RecordOffset)
ScopeEndSym(SymbolRecordKind Kind)
bool hasOptimizations() const
DefRangeRegisterHeader Hdr
uint32_t getRelocationOffset() const
uint8_t getLanguage() const
Annotations lets you mark points and ranges inside source code, for tests:
BinaryAnnotationIterator & operator=(const BinaryAnnotationIterator Other)
uint32_t getRelocationOffset() const
HeapAllocationSiteSym(uint32_t RecordOffset)
BinaryAnnotationsOpCode OpCode
EncodedFramePtrReg
Two-bit value indicating which register is the designated frame pointer register.
uint16_t VersionFrontendMajor
uint16_t VersionFrontendMinor
uint16_t VersionBackendBuild
DefRangeSubfieldSym(SymbolRecordKind Kind)
uint16_t VersionFrontendMinor
std::vector< StringRef > Fields
LocalSym(uint32_t RecordOffset)
uint32_t ModFilenameOffset
CallSiteInfoSym(uint32_t RecordOffset)
FrameCookieSym(uint32_t RecordOffset)
CompileSym3Flags getFlags() const
LabelSym(uint32_t RecordOffset)
UDTSym(uint32_t RecordOffset)
PublicSym32(SymbolRecordKind Kind)
uint16_t VersionFrontendQFE
BuildInfoSym(uint32_t RecordOffset)
BPRelativeSym(uint32_t RecordOffset)
EnvBlockSym(uint32_t RecordOffset)
std::vector< LocalVariableAddrGap > Gaps
An arbitrary precision integer that knows its signedness.
LocalVariableAddrRange Range
Compile3Sym(uint32_t RecordOffset)
uint32_t OffsetOfExceptionHandler
DefRangeRegisterRelSym(SymbolRecordKind Kind)
HeapAllocationSiteSym(SymbolRecordKind Kind)
LocalVariableAddrRange Range
ThreadLocalDataSym(SymbolRecordKind Kind)
Compile3Sym(SymbolRecordKind Kind)
uint32_t getRelocationOffset() const
Expected< CVSymbol > readSymbolFromStream(BinaryStreamRef Stream, uint32_t Offset)
Compile2Sym(uint32_t RecordOffset)
detail::packed_endian_specific_integral< uint32_t, little, unaligned > ulittle32_t
EnvBlockSym(SymbolRecordKind Kind)
DefRangeSubfieldSym(uint32_t RecordOffset)
uint32_t BytesOfCalleeSavedRegisters
SectionSym(SymbolRecordKind Kind)
uint32_t getFlags() const
PublicSym32(uint32_t RecordOffset)
std::vector< LocalVariableAddrGap > Gaps
detail::packed_endian_specific_integral< uint16_t, little, unaligned > ulittle16_t
SourceLanguage getLanguage() const
ObjNameSym(uint32_t RecordOffset)
DefRangeFramePointerRelFullScopeSym(uint32_t RecordOffset)
PublicSymFlags
Corresponds to the CV_PUBSYMFLAGS bitfield.
uint16_t VersionFrontendBuild
const DecodedAnnotation & operator*()
FrameProcSym(uint32_t RecordOffset)
CRTP base class which implements the entire standard iterator facade in terms of a minimal subset of ...
ScopeEndSym(SymbolRecordKind Kind, uint32_t RecordOffset)
uint16_t CallInstructionSize
DefRangeRegisterRelHeader Hdr
uint32_t getRelocationOffset() const
uint16_t VersionBackendMinor
LocalVariableAddrRange Range
BuildInfoSym(SymbolRecordKind Kind)
ThreadLocalDataSym(uint32_t RecordOffset)
RegisterSym(uint32_t RecordOffset)
RegRelativeSym(SymbolRecordKind Kind)
SectionSym(SymbolRecordKind Kind, uint32_t RecordOffset)
A Module instance is used to store all the information related to an LLVM module.
uint32_t getRelocationOffset() const
uint32_t getRelocationOffset() const
CallerSym(SymbolRecordKind Kind)
bool operator==(BinaryAnnotationIterator Other) const
ArrayRef< uint8_t > Bytes
SourceLanguage
These values correspond to the CV_CFL_LANG enumeration, and are documented here: https://msdn....
std::vector< TypeIndex > Indices
DefRangeSym(uint32_t RecordOffset)
uint16_t VersionBackendMajor
Thunk32Sym(SymbolRecordKind Kind)
StringRef - Represent a constant reference to a string, i.e.
RegRelativeSym(uint32_t RecordOffset)
std::vector< StringRef > ExtraStrings
DefRangeRegisterSym(uint32_t RecordOffset)
std::vector< LocalVariableAddrGap > Gaps
DataSym(uint32_t RecordOffset)
uint16_t VersionBackendMinor
uint32_t getRelocationOffset() const
uint32_t getRelocationOffset() const
uint32_t PaddingFrameBytes
std::vector< LocalVariableAddrGap > Gaps
RegisterId getParamFramePtrReg(CPUType CPU) const
Extract the register this frame uses to refer to parameters.
@ ChangeCodeLengthAndCodeOffset
ConstantSym(uint32_t RecordOffset)
LocalSym(SymbolRecordKind Kind)
std::vector< uint8_t > AnnotationData
CompileSym2Flags
Corresponds to COMPILESYM2::Flags bitfield.
BinaryAnnotationIterator & operator++()
Wrapper class representing virtual and physical registers.
BinaryAnnotationIterator(const BinaryAnnotationIterator &Other)
CallSiteInfoSym(SymbolRecordKind Kind)
BinaryAnnotationIterator(ArrayRef< uint8_t > Annotations)
FileStaticSym(SymbolRecordKind Kind)
DefRangeSym(SymbolRecordKind Kind)
ProcRefSym(SymbolRecordKind Kind)
ObjNameSym(SymbolRecordKind Kind)
std::vector< StringRef > Strings
DefRangeFramePointerRelSym(SymbolRecordKind Kind)
uint32_t getRelocationOffset() const
ProcRefSym(uint32_t RecordOffset)
ArrayRef< T > take_front(size_t N=1) const
Return a copy of *this with only the first N elements.
RegisterId getLocalFramePtrReg(CPUType CPU) const
Extract the register this frame uses to refer to local variables.
detail::packed_endian_specific_integral< int32_t, little, unaligned > little32_t
Thunk32Sym(SymbolRecordKind Kind, uint32_t RecordOffset)
CPUType
These values correspond to the CV_CPU_TYPE_e enumeration, and are documented here: https://msdn....
DefRangeFramePointerRelSym(uint32_t RecordOffset)
uint16_t VersionBackendQFE
LabelSym(SymbolRecordKind Kind)
uint16_t offsetInParent() const
SymbolRecordKind
Distinguishes individual records in the Symbols subsection of a .debug$S section.
InlineSiteSym(uint32_t RecordOffset)
SymbolRecord(SymbolRecordKind Kind)
BlockSym(SymbolRecordKind Kind)
std::vector< LocalVariableAddrGap > Gaps
uint32_t getRelocationOffset() const
ThunkOrdinal
These values correspond to the THUNK_ORDINAL enumeration.
LocalSymFlags
Corresponds to CV_LVARFLAGS bitfield.
Compile2Sym(SymbolRecordKind Kind)
uint16_t SectionIdOfExceptionHandler
bool hasSpilledUDTMember() const
uint16_t VersionFrontendBuild
DefRangeFramePointerRelHeader Hdr
size_t size() const
size - Get the array size.
uint16_t VersionBackendMajor
A range adaptor for a pair of iterators.
uint32_t getRelocationOffset() const
@ ChangeCodeOffsetAndLineOffset
void setLanguage(SourceLanguage Lang)
DataSym(SymbolRecordKind Kind)
ProcSym(SymbolRecordKind Kind)
uint32_t getRelocationOffset() const
CompileSym3Flags
Corresponds to COMPILESYM3::Flags bitfield.
BlockSym(uint32_t RecordOffset)
LocalVariableAddrRange Range
ExportSym(uint32_t RecordOffset)
InlineSiteSym(SymbolRecordKind Kind)
LocalVariableAddrRange Range
iterator_range< BinaryAnnotationIterator > annotations() const
BPRelativeSym(SymbolRecordKind Kind)
BinaryStreamRef is to BinaryStream what ArrayRef is to an Array.
Optional< std::vector< StOtherPiece > > Other
RegisterId decodeFramePtrReg(EncodedFramePtrReg EncodedReg, CPUType CPU)
DefRangeFramePointerRelFullScopeSym(SymbolRecordKind Kind)
FrameCookieSym(SymbolRecordKind Kind)