10 #ifndef LLVM_DEBUGINFO_CODEVIEW_SYMBOLRECORD_H
11 #define LLVM_DEBUGINFO_CODEVIEW_SYMBOLRECORD_H
46 static constexpr
uint32_t RelocationOffset = 32;
173 : Data(Other.Data) {}
176 return Data == Other.Data;
180 return !(*
this ==
Other);
189 if (!ParseCurrentAnnotation()) {
206 ParseCurrentAnnotation();
207 return Current.getValue();
212 if (Annotations.
empty())
215 uint8_t FirstByte = Annotations.
front();
218 if ((FirstByte & 0x80) == 0x00)
221 if (Annotations.
empty())
224 uint8_t SecondByte = Annotations.
front();
227 if ((FirstByte & 0xC0) == 0x80)
228 return ((FirstByte & 0x3F) << 8) | SecondByte;
230 if (Annotations.
empty())
233 uint8_t ThirdByte = Annotations.
front();
236 if (Annotations.
empty())
239 uint8_t FourthByte = Annotations.
front();
242 if ((FirstByte & 0xE0) == 0xC0)
243 return ((FirstByte & 0x1F) << 24) | (SecondByte << 16) |
244 (ThirdByte << 8) | FourthByte;
249 static int32_t DecodeSignedOperand(
uint32_t Operand) {
251 return -(Operand >> 1);
255 static int32_t DecodeSignedOperand(ArrayRef<uint8_t> &Annotations) {
256 return DecodeSignedOperand(GetCompressedAnnotation(Annotations));
259 bool ParseCurrentAnnotation() {
260 if (Current.hasValue())
265 AnnotationData Result;
267 switch (Result.OpCode) {
269 Result.Name =
"Invalid";
270 Next = ArrayRef<uint8_t>();
273 Result.Name =
"CodeOffset";
274 Result.U1 = GetCompressedAnnotation(Next);
277 Result.Name =
"ChangeCodeOffsetBase";
278 Result.U1 = GetCompressedAnnotation(Next);
281 Result.Name =
"ChangeCodeOffset";
282 Result.U1 = GetCompressedAnnotation(Next);
285 Result.Name =
"ChangeCodeLength";
286 Result.U1 = GetCompressedAnnotation(Next);
289 Result.Name =
"ChangeFile";
290 Result.U1 = GetCompressedAnnotation(Next);
293 Result.Name =
"ChangeLineEndDelta";
294 Result.U1 = GetCompressedAnnotation(Next);
297 Result.Name =
"ChangeRangeKind";
298 Result.U1 = GetCompressedAnnotation(Next);
301 Result.Name =
"ChangeColumnStart";
302 Result.U1 = GetCompressedAnnotation(Next);
305 Result.Name =
"ChangeColumnEnd";
306 Result.U1 = GetCompressedAnnotation(Next);
309 Result.Name =
"ChangeLineOffset";
310 Result.S1 = DecodeSignedOperand(Next);
313 Result.Name =
"ChangeColumnEndDelta";
314 Result.S1 = DecodeSignedOperand(Next);
317 Result.Name =
"ChangeCodeOffsetAndLineOffset";
319 Result.S1 = DecodeSignedOperand(Annotation >> 4);
320 Result.U1 = Annotation & 0xf;
324 Result.Name =
"ChangeCodeLengthAndCodeOffset";
325 Result.U1 = GetCompressedAnnotation(Next);
326 Result.U2 = GetCompressedAnnotation(Next);
334 Optional<AnnotationData> Current;
335 ArrayRef<uint8_t> Data;
336 ArrayRef<uint8_t> Next;
345 RecordOffset(RecordOffset) {}
366 RecordOffset(RecordOffset) {}
382 RecordOffset(RecordOffset) {}
436 static constexpr
uint32_t RelocationOffset = 8;
442 RecordOffset(RecordOffset) {}
450 std::vector<LocalVariableAddrGap>
Gaps;
457 static constexpr
uint32_t RelocationOffset = 12;
463 RecordOffset(RecordOffset) {}
472 std::vector<LocalVariableAddrGap>
Gaps;
487 RecordOffset(RecordOffset) {}
493 std::vector<LocalVariableAddrGap>
Gaps;
510 RecordOffset(RecordOffset) {}
516 std::vector<LocalVariableAddrGap>
Gaps;
523 static constexpr
uint32_t RelocationOffset = 8;
530 RecordOffset(RecordOffset) {}
538 std::vector<LocalVariableAddrGap>
Gaps;
554 RecordOffset(RecordOffset) {}
572 std::vector<LocalVariableAddrGap>
Gaps;
584 RecordOffset(RecordOffset) {}
593 static constexpr
uint32_t RelocationOffset = 16;
616 static constexpr
uint32_t RelocationOffset = 4;
655 RecordOffset(RecordOffset) {}
682 RecordOffset(RecordOffset) {}
698 RecordOffset(RecordOffset) {}
723 RecordOffset(RecordOffset) {}
749 RecordOffset(RecordOffset) {}
764 static constexpr
uint32_t RelocationOffset = 4;
784 static constexpr
uint32_t RelocationOffset = 4;
790 RecordOffset(RecordOffset) {}
806 static constexpr
uint32_t RelocationOffset = 4;
844 RecordOffset(RecordOffset) {}
857 RecordOffset(RecordOffset) {}
872 RecordOffset(RecordOffset) {}
888 RecordOffset(RecordOffset) {}
899 static constexpr
uint32_t RelocationOffset = 8;
920 static constexpr
uint32_t RelocationOffset = 8;
926 RecordOffset(RecordOffset) {}
946 #endif // LLVM_DEBUGINFO_CODEVIEW_SYMBOLRECORD_H
uint32_t getRelocationOffset() const
DefRangeFramePointerRelSym(SymbolRecordKind Kind)
uint32_t ModFilenameOffset
uint32_t OffsetOfExceptionHandler
SymbolRecordKind
Distinguishes individual records in the Symbols subsection of a .debug$S section. ...
ObjNameSym(uint32_t RecordOffset)
Thunk32Sym(SymbolRecordKind Kind, uint32_t RecordOffset)
CompileSym3Flags
Corresponds to COMPILESYM3::Flags bitfield.
uint32_t getRelocationOffset() const
DefRangeSubfieldRegisterSym(SymbolRecordKind Kind)
bool operator!=(BinaryAnnotationIterator Other) const
UDTSym(SymbolRecordKind Kind)
BPRelativeSym(SymbolRecordKind Kind)
const T & front() const
front - Get the first element.
LocalSym(SymbolRecordKind Kind)
msf::VarStreamArray< CVSymbol > CVSymbolArray
uint16_t SectionIdOfExceptionHandler
PublicSym32(SymbolRecordKind Kind)
FrameProcedureOptions Flags
uint32_t getRelocationOffset() const
This provides a very simple, boring adaptor for a begin and end iterator into a range type...
uint32_t BytesOfCalleeSavedRegisters
SymbolRecordKind getKind() const
uint32_t getRelocationOffset() const
ProcRefSym(uint32_t RecordOffset)
uint16_t VersionBackendMinor
ScopeEndSym(SymbolRecordKind Kind)
bool hasSpilledUDTMember() const
BlockSym(uint32_t RecordOffset)
uint16_t VersionFrontendMajor
llvm::iterator_range< BinaryAnnotationIterator > annotations() const
ConstantSym(uint32_t RecordOffset)
RegRelativeSym(SymbolRecordKind Kind)
ConstantSym(SymbolRecordKind Kind)
std::vector< LocalVariableAddrGap > Gaps
EnvBlockSym(SymbolRecordKind Kind)
ArrayRef< uint8_t > VariantData
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)
ThreadLocalDataSym(uint32_t RecordOffset)
DefRangeRegisterRelSym(uint32_t RecordOffset)
uint16_t VersionBackendMajor
LabelSym(SymbolRecordKind Kind)
bool operator==(BinaryAnnotationIterator Other) const
EnvBlockSym(uint32_t RecordOffset)
std::vector< StringRef > ExtraStrings
BinaryAnnotationIterator(const BinaryAnnotationIterator &Other)
uint32_t getRelocationOffset() const
CallSiteInfoSym(SymbolRecordKind Kind)
uint16_t CallInstructionSize
uint32_t getRelocationOffset() const
BinaryAnnotationIterator()=default
RegisterSym(SymbolRecordKind Kind)
InlineSiteSym(uint32_t RecordOffset)
uint32_t getRelocationOffset() const
BinaryAnnotationIterator(ArrayRef< uint8_t > Annotations)
BlockSym(SymbolRecordKind Kind)
uint16_t VersionFrontendBuild
FrameCookieSym(SymbolRecordKind Kind)
DataSym(uint32_t RecordOffset)
std::vector< LocalVariableAddrGap > Gaps
ExportSym(uint32_t RecordOffset)
FrameProcSym(SymbolRecordKind Kind)
RegRelativeSym(uint32_t RecordOffset)
HeapAllocationSiteSym(uint32_t RecordOffset)
std::vector< StringRef > Fields
LocalVariableAddrRange Range
LocalVariableAddrRange Range
uint32_t getRelocationOffset() const
uint32_t getRelocationOffset() const
uint16_t offsetInParent() const
BPRelativeSym(uint32_t RecordOffset)
DefRangeSym(uint32_t RecordOffset)
DefRangeRegisterSym(SymbolRecordKind Kind)
BinaryAnnotationIterator operator++(int)
DataSym(SymbolRecordKind Kind)
CVRecord< SymbolKind > CVSymbol
uint16_t VersionBackendMajor
SectionSym(SymbolRecordKind Kind, uint32_t RecordOffset)
uint32_t getRelocationOffset() const
std::vector< TypeIndex > Indices
bool empty() const
empty - Check if the array is empty.
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++()
LocalVariableAddrRange Range
uint16_t VersionFrontendMinor
uint16_t VersionFrontendMinor
ThreadLocalDataSym(SymbolRecordKind Kind)
iterator_range< T > make_range(T x, T y)
Convenience function for iterating over sub-ranges.
uint32_t getFlags() const
detail::packed_endian_specific_integral< int32_t, little, unaligned > little32_t
LocalVariableAddrRange Range
uint16_t VersionBackendMinor
CPUType
These values correspond to the CV_CPU_TYPE_e enumeration, and are documented here: https://msdn...
LocalVariableAddrRange Range
uint8_t getLanguage() const
TrampolineSym(SymbolRecordKind Kind, uint32_t RecordOffset)
DefRangeFramePointerRelFullScopeSym(uint32_t RecordOffset)
Compile3Sym(SymbolRecordKind Kind)
uint32_t PaddingFrameBytes
uint8_t getLanguage() const
FrameProcSym(uint32_t RecordOffset)
A range adaptor for a pair of iterators.
detail::packed_endian_specific_integral< uint16_t, little, unaligned > ulittle16_t
Thunk32Sym(SymbolRecordKind Kind)
FrameCookieSym(uint32_t RecordOffset)
ScopeEndSym(SymbolRecordKind Kind, uint32_t RecordOffset)
CoffGroupSym(SymbolRecordKind Kind)
std::vector< LocalVariableAddrGap > Gaps
DefRangeFramePointerRelSym(uint32_t RecordOffset)
uint16_t VersionBackendBuild
LabelSym(uint32_t RecordOffset)
HeapAllocationSiteSym(SymbolRecordKind Kind)
uint32_t getRelocationOffset() const
InlineSiteSym(SymbolRecordKind Kind)
SectionSym(SymbolRecordKind Kind)
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)
uint32_t getFlags() const
CoffGroupSym(SymbolRecordKind Kind, uint32_t RecordOffset)
TrampolineSym(SymbolRecordKind Kind)
detail::packed_endian_specific_integral< uint32_t, little, unaligned > ulittle32_t
std::vector< LocalVariableAddrGap > Gaps
ArrayRef< T > drop_front(size_t N=1) const
Drop the first N elements of the array.
uint16_t VersionBackendQFE
DefRangeFramePointerRelFullScopeSym(SymbolRecordKind Kind)
Compile3Sym(uint32_t RecordOffset)
BuildInfoSym(SymbolRecordKind Kind)
uint32_t getRelocationOffset() const
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)
FileStaticSym(uint32_t RecordOffset)
DefRangeSubfieldSym(uint32_t RecordOffset)
CompileSym2Flags
Corresponds to COMPILESYM2::Flags bitfield.
ExportSym(SymbolRecordKind Kind)
DefRangeSubfieldSym(SymbolRecordKind Kind)
SymbolRecord(SymbolRecordKind Kind)
Compile2Sym(uint32_t RecordOffset)
uint16_t VersionFrontendBuild