LLVM  9.0.0svn
SymbolRecord.h
Go to the documentation of this file.
1 //===- SymbolRecord.h -------------------------------------------*- C++ -*-===//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
8 
9 #ifndef LLVM_DEBUGINFO_CODEVIEW_SYMBOLRECORD_H
10 #define LLVM_DEBUGINFO_CODEVIEW_SYMBOLRECORD_H
11 
12 #include "llvm/ADT/APSInt.h"
13 #include "llvm/ADT/ArrayRef.h"
14 #include "llvm/ADT/Optional.h"
15 #include "llvm/ADT/StringRef.h"
22 #include "llvm/Support/Endian.h"
23 #include <cstdint>
24 #include <vector>
25 
26 namespace llvm {
27 namespace codeview {
28 
29 class SymbolRecord {
30 protected:
31  explicit SymbolRecord(SymbolRecordKind Kind) : Kind(Kind) {}
32 
33 public:
34  SymbolRecordKind getKind() const { return Kind; }
35 
37 };
38 
39 // S_GPROC32, S_LPROC32, S_GPROC32_ID, S_LPROC32_ID, S_LPROC32_DPC or
40 // S_LPROC32_DPC_ID
41 class ProcSym : public SymbolRecord {
42  static constexpr uint32_t RelocationOffset = 32;
43 
44 public:
47  : SymbolRecord(Kind), RecordOffset(RecordOffset) {}
48 
50  return RecordOffset + RelocationOffset;
51  }
52 
53  uint32_t Parent = 0;
54  uint32_t End = 0;
55  uint32_t Next = 0;
56  uint32_t CodeSize = 0;
57  uint32_t DbgStart = 0;
58  uint32_t DbgEnd = 0;
61  uint16_t Segment = 0;
64 
65  uint32_t RecordOffset = 0;
66 };
67 
68 // S_THUNK32
69 class Thunk32Sym : public SymbolRecord {
70 public:
73  : SymbolRecord(Kind), RecordOffset(RecordOffset) {}
74 
79  uint16_t Segment;
80  uint16_t Length;
84 
86 };
87 
88 // S_TRAMPOLINE
89 class TrampolineSym : public SymbolRecord {
90 public:
93  : SymbolRecord(Kind), RecordOffset(RecordOffset) {}
94 
96  uint16_t Size;
99  uint16_t ThunkSection;
100  uint16_t TargetSection;
101 
103 };
104 
105 // S_SECTION
106 class SectionSym : public SymbolRecord {
107 public:
110  : SymbolRecord(Kind), RecordOffset(RecordOffset) {}
111 
112  uint16_t SectionNumber;
113  uint8_t Alignment;
118 
120 };
121 
122 // S_COFFGROUP
123 class CoffGroupSym : public SymbolRecord {
124 public:
127  : SymbolRecord(Kind), RecordOffset(RecordOffset) {}
128 
132  uint16_t Segment;
134 
136 };
137 
138 class ScopeEndSym : public SymbolRecord {
139 public:
142  : SymbolRecord(Kind), RecordOffset(RecordOffset) {}
143 
145 };
146 
147 class CallerSym : public SymbolRecord {
148 public:
151  : SymbolRecord(Kind), RecordOffset(RecordOffset) {}
152 
153  std::vector<TypeIndex> Indices;
154 
156 };
157 
159  struct AnnotationData {
164  int32_t S1;
165  };
166 
167  BinaryAnnotationIterator() = default;
170  : Data(Other.Data) {}
171 
173  return Data == Other.Data;
174  }
175 
177  return !(*this == Other);
178  }
179 
181  Data = Other.Data;
182  return *this;
183  }
184 
186  if (!ParseCurrentAnnotation()) {
187  *this = BinaryAnnotationIterator();
188  return *this;
189  }
190  Data = Next;
191  Next = ArrayRef<uint8_t>();
192  Current.reset();
193  return *this;
194  }
195 
197  BinaryAnnotationIterator Orig(*this);
198  ++(*this);
199  return Orig;
200  }
201 
203  ParseCurrentAnnotation();
204  return Current.getValue();
205  }
206 
207 private:
208  static uint32_t GetCompressedAnnotation(ArrayRef<uint8_t> &Annotations) {
209  if (Annotations.empty())
210  return -1;
211 
212  uint8_t FirstByte = Annotations.front();
213  Annotations = Annotations.drop_front();
214 
215  if ((FirstByte & 0x80) == 0x00)
216  return FirstByte;
217 
218  if (Annotations.empty())
219  return -1;
220 
221  uint8_t SecondByte = Annotations.front();
222  Annotations = Annotations.drop_front();
223 
224  if ((FirstByte & 0xC0) == 0x80)
225  return ((FirstByte & 0x3F) << 8) | SecondByte;
226 
227  if (Annotations.empty())
228  return -1;
229 
230  uint8_t ThirdByte = Annotations.front();
231  Annotations = Annotations.drop_front();
232 
233  if (Annotations.empty())
234  return -1;
235 
236  uint8_t FourthByte = Annotations.front();
237  Annotations = Annotations.drop_front();
238 
239  if ((FirstByte & 0xE0) == 0xC0)
240  return ((FirstByte & 0x1F) << 24) | (SecondByte << 16) |
241  (ThirdByte << 8) | FourthByte;
242 
243  return -1;
244  };
245 
246  static int32_t DecodeSignedOperand(uint32_t Operand) {
247  if (Operand & 1)
248  return -(Operand >> 1);
249  return Operand >> 1;
250  };
251 
252  static int32_t DecodeSignedOperand(ArrayRef<uint8_t> &Annotations) {
253  return DecodeSignedOperand(GetCompressedAnnotation(Annotations));
254  };
255 
256  bool ParseCurrentAnnotation() {
257  if (Current.hasValue())
258  return true;
259 
260  Next = Data;
261  uint32_t Op = GetCompressedAnnotation(Next);
262  AnnotationData Result;
263  Result.OpCode = static_cast<BinaryAnnotationsOpCode>(Op);
264  switch (Result.OpCode) {
266  Result.Name = "Invalid";
267  Next = ArrayRef<uint8_t>();
268  break;
270  Result.Name = "CodeOffset";
271  Result.U1 = GetCompressedAnnotation(Next);
272  break;
274  Result.Name = "ChangeCodeOffsetBase";
275  Result.U1 = GetCompressedAnnotation(Next);
276  break;
278  Result.Name = "ChangeCodeOffset";
279  Result.U1 = GetCompressedAnnotation(Next);
280  break;
282  Result.Name = "ChangeCodeLength";
283  Result.U1 = GetCompressedAnnotation(Next);
284  break;
286  Result.Name = "ChangeFile";
287  Result.U1 = GetCompressedAnnotation(Next);
288  break;
290  Result.Name = "ChangeLineEndDelta";
291  Result.U1 = GetCompressedAnnotation(Next);
292  break;
294  Result.Name = "ChangeRangeKind";
295  Result.U1 = GetCompressedAnnotation(Next);
296  break;
298  Result.Name = "ChangeColumnStart";
299  Result.U1 = GetCompressedAnnotation(Next);
300  break;
302  Result.Name = "ChangeColumnEnd";
303  Result.U1 = GetCompressedAnnotation(Next);
304  break;
306  Result.Name = "ChangeLineOffset";
307  Result.S1 = DecodeSignedOperand(Next);
308  break;
310  Result.Name = "ChangeColumnEndDelta";
311  Result.S1 = DecodeSignedOperand(Next);
312  break;
314  Result.Name = "ChangeCodeOffsetAndLineOffset";
315  uint32_t Annotation = GetCompressedAnnotation(Next);
316  Result.S1 = DecodeSignedOperand(Annotation >> 4);
317  Result.U1 = Annotation & 0xf;
318  break;
319  }
321  Result.Name = "ChangeCodeLengthAndCodeOffset";
322  Result.U1 = GetCompressedAnnotation(Next);
323  Result.U2 = GetCompressedAnnotation(Next);
324  break;
325  }
326  }
327  Current = Result;
328  return true;
329  }
330 
331  Optional<AnnotationData> Current;
333  ArrayRef<uint8_t> Next;
334 };
335 
336 // S_INLINESITE
337 class InlineSiteSym : public SymbolRecord {
338 public:
340  InlineSiteSym(uint32_t RecordOffset)
342  RecordOffset(RecordOffset) {}
343 
345  return make_range(BinaryAnnotationIterator(AnnotationData),
347  }
348 
352  std::vector<uint8_t> AnnotationData;
353 
355 };
356 
357 // S_PUB32
358 class PublicSym32 : public SymbolRecord {
359 public:
362  explicit PublicSym32(uint32_t RecordOffset)
364  RecordOffset(RecordOffset) {}
365 
368  uint16_t Segment = 0;
370 
371  uint32_t RecordOffset = 0;
372 };
373 
374 // S_REGISTER
375 class RegisterSym : public SymbolRecord {
376 public:
378  RegisterSym(uint32_t RecordOffset)
380  RecordOffset(RecordOffset) {}
381 
385 
387 };
388 
389 // S_PROCREF, S_LPROCREF
390 class ProcRefSym : public SymbolRecord {
391 public:
393  explicit ProcRefSym(uint32_t RecordOffset)
394  : SymbolRecord(SymbolRecordKind::ProcRefSym), RecordOffset(RecordOffset) {
395  }
396 
399  uint16_t Module;
401 
402  uint16_t modi() const { return Module - 1; }
404 };
405 
406 // S_LOCAL
407 class LocalSym : public SymbolRecord {
408 public:
410  explicit LocalSym(uint32_t RecordOffset)
411  : SymbolRecord(SymbolRecordKind::LocalSym), RecordOffset(RecordOffset) {}
412 
416 
418 };
419 
422  uint16_t ISectStart;
423  uint16_t Range;
424 };
425 
427  uint16_t GapStartOffset;
428  uint16_t Range;
429 };
430 
431 enum : uint16_t { MaxDefRange = 0xf000 };
432 
433 // S_DEFRANGE
434 class DefRangeSym : public SymbolRecord {
435  static constexpr uint32_t RelocationOffset = 8;
436 
437 public:
439  explicit DefRangeSym(uint32_t RecordOffset)
441  RecordOffset(RecordOffset) {}
442 
444  return RecordOffset + RelocationOffset;
445  }
446 
449  std::vector<LocalVariableAddrGap> Gaps;
450 
452 };
453 
454 // S_DEFRANGE_SUBFIELD
456  static constexpr uint32_t RelocationOffset = 12;
457 
458 public:
462  RecordOffset(RecordOffset) {}
463 
465  return RecordOffset + RelocationOffset;
466  }
467 
469  uint16_t OffsetInParent;
471  std::vector<LocalVariableAddrGap> Gaps;
472 
474 };
475 
476 // S_DEFRANGE_REGISTER
478 public:
479  struct Header {
482  };
483 
487  RecordOffset(RecordOffset) {}
488 
489  uint32_t getRelocationOffset() const { return RecordOffset + sizeof(Header); }
490 
493  std::vector<LocalVariableAddrGap> Gaps;
494 
496 };
497 
498 // S_DEFRANGE_SUBFIELD_REGISTER
500 public:
501  struct Header {
505  };
506 
508  : SymbolRecord(Kind) {}
511  RecordOffset(RecordOffset) {}
512 
513  uint32_t getRelocationOffset() const { return RecordOffset + sizeof(Header); }
514 
517  std::vector<LocalVariableAddrGap> Gaps;
518 
520 };
521 
522 // S_DEFRANGE_FRAMEPOINTER_REL
524  static constexpr uint32_t RelocationOffset = 8;
525 
526 public:
528  : SymbolRecord(Kind) {}
531  RecordOffset(RecordOffset) {}
532 
534  return RecordOffset + RelocationOffset;
535  }
536 
537  int32_t Offset;
539  std::vector<LocalVariableAddrGap> Gaps;
540 
542 };
543 
544 // S_DEFRANGE_REGISTER_REL
546 public:
547  struct Header {
551  };
552 
554  explicit DefRangeRegisterRelSym(uint32_t RecordOffset)
556  RecordOffset(RecordOffset) {}
557 
558  // The flags implement this notional bitfield:
559  // uint16_t IsSubfield : 1;
560  // uint16_t Padding : 3;
561  // uint16_t OffsetInParent : 12;
562  enum : uint16_t {
563  IsSubfieldFlag = 1,
564  OffsetInParentShift = 4,
565  };
566 
567  bool hasSpilledUDTMember() const { return Hdr.Flags & IsSubfieldFlag; }
568  uint16_t offsetInParent() const { return Hdr.Flags >> OffsetInParentShift; }
569 
570  uint32_t getRelocationOffset() const { return RecordOffset + sizeof(Header); }
571 
574  std::vector<LocalVariableAddrGap> Gaps;
575 
577 };
578 
579 // S_DEFRANGE_FRAMEPOINTER_REL_FULL_SCOPE
581 public:
583  : SymbolRecord(Kind) {}
586  RecordOffset(RecordOffset) {}
587 
588  int32_t Offset;
589 
591 };
592 
593 // S_BLOCK32
594 class BlockSym : public SymbolRecord {
595  static constexpr uint32_t RelocationOffset = 16;
596 
597 public:
599  explicit BlockSym(uint32_t RecordOffset)
600  : SymbolRecord(SymbolRecordKind::BlockSym), RecordOffset(RecordOffset) {}
601 
603  return RecordOffset + RelocationOffset;
604  }
605 
610  uint16_t Segment;
612 
614 };
615 
616 // S_LABEL32
617 class LabelSym : public SymbolRecord {
618  static constexpr uint32_t RelocationOffset = 4;
619 
620 public:
622  explicit LabelSym(uint32_t RecordOffset)
623  : SymbolRecord(SymbolRecordKind::LabelSym), RecordOffset(RecordOffset) {}
624 
626  return RecordOffset + RelocationOffset;
627  }
628 
630  uint16_t Segment;
633 
635 };
636 
637 // S_OBJNAME
638 class ObjNameSym : public SymbolRecord {
639 public:
642  ObjNameSym(uint32_t RecordOffset)
643  : SymbolRecord(SymbolRecordKind::ObjNameSym), RecordOffset(RecordOffset) {
644  }
645 
648 
650 };
651 
652 // S_ENVBLOCK
653 class EnvBlockSym : public SymbolRecord {
654 public:
656  EnvBlockSym(uint32_t RecordOffset)
658  RecordOffset(RecordOffset) {}
659 
660  std::vector<StringRef> Fields;
661 
663 };
664 
665 // S_EXPORT
666 class ExportSym : public SymbolRecord {
667 public:
669  ExportSym(uint32_t RecordOffset)
670  : SymbolRecord(SymbolRecordKind::ExportSym), RecordOffset(RecordOffset) {}
671 
672  uint16_t Ordinal;
675 
677 };
678 
679 // S_FILESTATIC
680 class FileStaticSym : public SymbolRecord {
681 public:
683  FileStaticSym(uint32_t RecordOffset)
685  RecordOffset(RecordOffset) {}
686 
691 
693 };
694 
695 // S_COMPILE2
696 class Compile2Sym : public SymbolRecord {
697 public:
699  Compile2Sym(uint32_t RecordOffset)
701  RecordOffset(RecordOffset) {}
702 
712  std::vector<StringRef> ExtraStrings;
713 
714  uint8_t getLanguage() const { return static_cast<uint32_t>(Flags) & 0xFF; }
715  uint32_t getFlags() const { return static_cast<uint32_t>(Flags) & ~0xFF; }
716 
718 };
719 
720 // S_COMPILE3
721 class Compile3Sym : public SymbolRecord {
722 public:
725  Compile3Sym(uint32_t RecordOffset)
727  RecordOffset(RecordOffset) {}
728 
740 
742  Flags = CompileSym3Flags((uint32_t(Flags) & 0xFFFFFF00) | uint32_t(Lang));
743  }
744 
746  return static_cast<SourceLanguage>(static_cast<uint32_t>(Flags) & 0xFF);
747  }
749  return static_cast<CompileSym3Flags>(static_cast<uint32_t>(Flags) & ~0xFF);
750  }
751 
752  bool hasOptimizations() const {
753  return CompileSym3Flags::None !=
755  }
756 
758 };
759 
760 // S_FRAMEPROC
761 class FrameProcSym : public SymbolRecord {
762 public:
764  explicit FrameProcSym(uint32_t RecordOffset)
766  RecordOffset(RecordOffset) {}
767 
775 
776  /// Extract the register this frame uses to refer to local variables.
778  return decodeFramePtrReg(
779  EncodedFramePtrReg((uint32_t(Flags) >> 14U) & 0x3U), CPU);
780  }
781 
782  /// Extract the register this frame uses to refer to parameters.
784  return decodeFramePtrReg(
785  EncodedFramePtrReg((uint32_t(Flags) >> 16U) & 0x3U), CPU);
786  }
787 
789 
790 private:
791 };
792 
793 // S_CALLSITEINFO
795  static constexpr uint32_t RelocationOffset = 4;
796 
797 public:
799  explicit CallSiteInfoSym(uint32_t RecordOffset)
801 
803  return RecordOffset + RelocationOffset;
804  }
805 
807  uint16_t Segment;
809 
811 };
812 
813 // S_HEAPALLOCSITE
815  static constexpr uint32_t RelocationOffset = 4;
816 
817 public:
819  explicit HeapAllocationSiteSym(uint32_t RecordOffset)
821  RecordOffset(RecordOffset) {}
822 
824  return RecordOffset + RelocationOffset;
825  }
826 
828  uint16_t Segment;
831 
833 };
834 
835 // S_FRAMECOOKIE
836 class FrameCookieSym : public SymbolRecord {
837  static constexpr uint32_t RelocationOffset = 4;
838 
839 public:
841  explicit FrameCookieSym(uint32_t RecordOffset)
843 
845  return RecordOffset + RelocationOffset;
846  }
847 
849  uint16_t Register;
851  uint8_t Flags;
852 
854 };
855 
856 // S_UDT, S_COBOLUDT
857 class UDTSym : public SymbolRecord {
858 public:
860  explicit UDTSym(uint32_t RecordOffset)
862 
865 
867 };
868 
869 // S_BUILDINFO
870 class BuildInfoSym : public SymbolRecord {
871 public:
873  BuildInfoSym(uint32_t RecordOffset)
875  RecordOffset(RecordOffset) {}
876 
878 
880 };
881 
882 // S_BPREL32
883 class BPRelativeSym : public SymbolRecord {
884 public:
886  explicit BPRelativeSym(uint32_t RecordOffset)
888  RecordOffset(RecordOffset) {}
889 
890  int32_t Offset;
893 
895 };
896 
897 // S_REGREL32
898 class RegRelativeSym : public SymbolRecord {
899 public:
901  explicit RegRelativeSym(uint32_t RecordOffset)
903  RecordOffset(RecordOffset) {}
904 
909 
911 };
912 
913 // S_CONSTANT, S_MANCONSTANT
914 class ConstantSym : public SymbolRecord {
915 public:
917  ConstantSym(uint32_t RecordOffset)
919  RecordOffset(RecordOffset) {}
920 
924 
926 };
927 
928 // S_LDATA32, S_GDATA32, S_LMANDATA, S_GMANDATA
929 class DataSym : public SymbolRecord {
930  static constexpr uint32_t RelocationOffset = 8;
931 
932 public:
934  DataSym(uint32_t RecordOffset)
935  : SymbolRecord(SymbolRecordKind::DataSym), RecordOffset(RecordOffset) {}
936 
938  return RecordOffset + RelocationOffset;
939  }
940 
943  uint16_t Segment;
945 
947 };
948 
949 // S_LTHREAD32, S_GTHREAD32
951  static constexpr uint32_t RelocationOffset = 8;
952 
953 public:
955  explicit ThreadLocalDataSym(uint32_t RecordOffset)
957  RecordOffset(RecordOffset) {}
958 
960  return RecordOffset + RelocationOffset;
961  }
962 
965  uint16_t Segment;
967 
969 };
970 
971 // S_UNAMESPACE
973 public:
975  explicit UsingNamespaceSym(uint32_t RecordOffset)
977  RecordOffset(RecordOffset) {}
978 
980 
982 };
983 
984 // S_ANNOTATION
985 class AnnotationSym : public SymbolRecord {
986 public:
988  explicit AnnotationSym(uint32_t RecordOffset)
990  RecordOffset(RecordOffset) {}
991 
993  uint16_t Segment = 0;
994  std::vector<StringRef> Strings;
995 
997 };
998 
1001 
1003  uint32_t Offset);
1004 
1005 } // end namespace codeview
1006 } // end namespace llvm
1007 
1008 #endif // LLVM_DEBUGINFO_CODEVIEW_SYMBOLRECORD_H
const T & front() const
front - Get the first element.
Definition: ArrayRef.h:151
DefRangeFramePointerRelSym(SymbolRecordKind Kind)
Definition: SymbolRecord.h:527
uint32_t getRelocationOffset() const
Definition: SymbolRecord.h:802
SymbolRecordKind
Distinguishes individual records in the Symbols subsection of a .debug$S section. ...
Definition: CodeView.h:40
This class represents lattice values for constants.
Definition: AllocatorList.h:23
uint32_t getRelocationOffset() const
Definition: SymbolRecord.h:844
ObjNameSym(uint32_t RecordOffset)
Definition: SymbolRecord.h:642
Thunk32Sym(SymbolRecordKind Kind, uint32_t RecordOffset)
Definition: SymbolRecord.h:72
CompileSym3Flags
Corresponds to COMPILESYM3::Flags bitfield.
Definition: CodeView.h:455
DefRangeSubfieldRegisterSym(SymbolRecordKind Kind)
Definition: SymbolRecord.h:507
UDTSym(SymbolRecordKind Kind)
Definition: SymbolRecord.h:859
BPRelativeSym(SymbolRecordKind Kind)
Definition: SymbolRecord.h:885
CompileSym3Flags getFlags() const
Definition: SymbolRecord.h:748
LocalSym(SymbolRecordKind Kind)
Definition: SymbolRecord.h:409
PublicSym32(SymbolRecordKind Kind)
Definition: SymbolRecord.h:361
FrameProcedureOptions Flags
Definition: SymbolRecord.h:774
This provides a very simple, boring adaptor for a begin and end iterator into a range type...
static DecodeStatus DecodeSignedOperand(MCInst &Inst, unsigned InsnS, uint64_t Address=0, const void *Decoder=nullptr)
UsingNamespaceSym(SymbolRecordKind Kind)
Definition: SymbolRecord.h:974
bool operator!=(const BinaryAnnotationIterator &Other) const
Definition: SymbolRecord.h:176
ProcRefSym(uint32_t RecordOffset)
Definition: SymbolRecord.h:393
ScopeEndSym(SymbolRecordKind Kind)
Definition: SymbolRecord.h:140
detail::packed_endian_specific_integral< uint16_t, little, unaligned > ulittle16_t
Definition: Endian.h:272
BlockSym(uint32_t RecordOffset)
Definition: SymbolRecord.h:599
ConstantSym(uint32_t RecordOffset)
Definition: SymbolRecord.h:917
RegRelativeSym(SymbolRecordKind Kind)
Definition: SymbolRecord.h:900
ConstantSym(SymbolRecordKind Kind)
Definition: SymbolRecord.h:916
std::vector< LocalVariableAddrGap > Gaps
Definition: SymbolRecord.h:517
EnvBlockSym(SymbolRecordKind Kind)
Definition: SymbolRecord.h:655
ArrayRef< uint8_t > VariantData
Definition: SymbolRecord.h:83
void setLanguage(SourceLanguage Lang)
Definition: SymbolRecord.h:741
UDTSym(uint32_t RecordOffset)
Definition: SymbolRecord.h:860
CallerSym(SymbolRecordKind Kind, uint32_t RecordOffset)
Definition: SymbolRecord.h:150
std::vector< LocalVariableAddrGap > Gaps
Definition: SymbolRecord.h:574
std::vector< uint8_t > AnnotationData
Definition: SymbolRecord.h:352
DefRangeRegisterSym(uint32_t RecordOffset)
Definition: SymbolRecord.h:485
RegisterId getParamFramePtrReg(CPUType CPU) const
Extract the register this frame uses to refer to parameters.
Definition: SymbolRecord.h:783
ProcRefSym(SymbolRecordKind Kind)
Definition: SymbolRecord.h:392
Tagged union holding either a T or a Error.
Definition: CachePruning.h:22
ThreadLocalDataSym(uint32_t RecordOffset)
Definition: SymbolRecord.h:955
DefRangeRegisterRelSym(uint32_t RecordOffset)
Definition: SymbolRecord.h:554
AnnotationSym(uint32_t RecordOffset)
Definition: SymbolRecord.h:988
LabelSym(SymbolRecordKind Kind)
Definition: SymbolRecord.h:621
uint8_t getLanguage() const
Definition: SymbolRecord.h:714
EnvBlockSym(uint32_t RecordOffset)
Definition: SymbolRecord.h:656
std::vector< StringRef > ExtraStrings
Definition: SymbolRecord.h:712
BinaryAnnotationIterator(const BinaryAnnotationIterator &Other)
Definition: SymbolRecord.h:169
PublicSymFlags
Corresponds to the CV_PUBSYMFLAGS bitfield.
Definition: CodeView.h:415
A 32-bit type reference.
Definition: TypeIndex.h:95
CallSiteInfoSym(SymbolRecordKind Kind)
Definition: SymbolRecord.h:798
RegisterSym(SymbolRecordKind Kind)
Definition: SymbolRecord.h:377
InlineSiteSym(uint32_t RecordOffset)
Definition: SymbolRecord.h:340
uint32_t getRelocationOffset() const
Definition: SymbolRecord.h:443
BinaryAnnotationIterator(ArrayRef< uint8_t > Annotations)
Definition: SymbolRecord.h:168
BlockSym(SymbolRecordKind Kind)
Definition: SymbolRecord.h:598
EncodedFramePtrReg
Two-bit value indicating which register is the designated frame pointer register. ...
Definition: CodeView.h:519
FrameCookieSym(SymbolRecordKind Kind)
Definition: SymbolRecord.h:840
DataSym(uint32_t RecordOffset)
Definition: SymbolRecord.h:934
std::vector< LocalVariableAddrGap > Gaps
Definition: SymbolRecord.h:493
ExportSym(uint32_t RecordOffset)
Definition: SymbolRecord.h:669
detail::packed_endian_specific_integral< uint32_t, little, unaligned > ulittle32_t
Definition: Endian.h:274
FrameProcSym(SymbolRecordKind Kind)
Definition: SymbolRecord.h:763
RegRelativeSym(uint32_t RecordOffset)
Definition: SymbolRecord.h:901
HeapAllocationSiteSym(uint32_t RecordOffset)
Definition: SymbolRecord.h:819
std::vector< StringRef > Fields
Definition: SymbolRecord.h:660
AnnotationSym(SymbolRecordKind Kind)
Definition: SymbolRecord.h:987
LocalVariableAddrRange Range
Definition: SymbolRecord.h:448
BPRelativeSym(uint32_t RecordOffset)
Definition: SymbolRecord.h:886
DefRangeSym(uint32_t RecordOffset)
Definition: SymbolRecord.h:439
DefRangeRegisterSym(SymbolRecordKind Kind)
Definition: SymbolRecord.h:484
BinaryAnnotationIterator operator++(int)
Definition: SymbolRecord.h:196
DataSym(SymbolRecordKind Kind)
Definition: SymbolRecord.h:933
uint32_t getFlags() const
Definition: SymbolRecord.h:715
SectionSym(SymbolRecordKind Kind, uint32_t RecordOffset)
Definition: SymbolRecord.h:109
std::vector< TypeIndex > Indices
Definition: SymbolRecord.h:153
const AnnotationData & operator*()
Definition: SymbolRecord.h:202
LocalVariableAddrRange Range
Definition: SymbolRecord.h:492
ProcSym(SymbolRecordKind Kind, uint32_t RecordOffset)
Definition: SymbolRecord.h:46
DefRangeSym(SymbolRecordKind Kind)
Definition: SymbolRecord.h:438
std::vector< LocalVariableAddrGap > Gaps
Definition: SymbolRecord.h:449
BinaryAnnotationIterator & operator=(const BinaryAnnotationIterator Other)
Definition: SymbolRecord.h:180
PublicSym32(uint32_t RecordOffset)
Definition: SymbolRecord.h:362
BinaryAnnotationIterator & operator++()
Definition: SymbolRecord.h:185
LocalVariableAddrRange Range
Definition: SymbolRecord.h:470
ThreadLocalDataSym(SymbolRecordKind Kind)
Definition: SymbolRecord.h:954
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.
Definition: CodeView.h:143
uint32_t getRelocationOffset() const
Definition: SymbolRecord.h:937
SymbolRecordKind getKind() const
Definition: SymbolRecord.h:34
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...
Definition: CodeView.h:78
std::vector< StringRef > Strings
Definition: SymbolRecord.h:994
TrampolineSym(SymbolRecordKind Kind, uint32_t RecordOffset)
Definition: SymbolRecord.h:92
Compile3Sym(SymbolRecordKind Kind)
Definition: SymbolRecord.h:724
FrameProcSym(uint32_t RecordOffset)
Definition: SymbolRecord.h:764
A range adaptor for a pair of iterators.
Thunk32Sym(SymbolRecordKind Kind)
Definition: SymbolRecord.h:71
FrameCookieSym(uint32_t RecordOffset)
Definition: SymbolRecord.h:841
ScopeEndSym(SymbolRecordKind Kind, uint32_t RecordOffset)
Definition: SymbolRecord.h:141
CoffGroupSym(SymbolRecordKind Kind)
Definition: SymbolRecord.h:125
bool operator==(BinaryAnnotationIterator Other) const
Definition: SymbolRecord.h:172
std::vector< LocalVariableAddrGap > Gaps
Definition: SymbolRecord.h:539
DefRangeFramePointerRelSym(uint32_t RecordOffset)
Definition: SymbolRecord.h:529
UsingNamespaceSym(uint32_t RecordOffset)
Definition: SymbolRecord.h:975
ArrayRef< T > drop_front(size_t N=1) const
Drop the first N elements of the array.
Definition: ArrayRef.h:187
SourceLanguage getLanguage() const
Definition: SymbolRecord.h:745
LabelSym(uint32_t RecordOffset)
Definition: SymbolRecord.h:622
detail::packed_endian_specific_integral< int32_t, little, unaligned > little32_t
Definition: Endian.h:281
HeapAllocationSiteSym(SymbolRecordKind Kind)
Definition: SymbolRecord.h:818
InlineSiteSym(SymbolRecordKind Kind)
Definition: SymbolRecord.h:339
SectionSym(SymbolRecordKind Kind)
Definition: SymbolRecord.h:108
uint32_t getRelocationOffset() const
Definition: SymbolRecord.h:49
CallerSym(SymbolRecordKind Kind)
Definition: SymbolRecord.h:149
LocalSym(uint32_t RecordOffset)
Definition: SymbolRecord.h:410
RegisterId getLocalFramePtrReg(CPUType CPU) const
Extract the register this frame uses to refer to local variables.
Definition: SymbolRecord.h:777
uint32_t getRelocationOffset() const
Definition: SymbolRecord.h:625
FileStaticSym(SymbolRecordKind Kind)
Definition: SymbolRecord.h:682
ThunkOrdinal
These values correspond to the THUNK_ORDINAL enumeration.
Definition: CodeView.h:531
RegisterSym(uint32_t RecordOffset)
Definition: SymbolRecord.h:378
iterator_range< BinaryAnnotationIterator > annotations() const
Definition: SymbolRecord.h:344
CoffGroupSym(SymbolRecordKind Kind, uint32_t RecordOffset)
Definition: SymbolRecord.h:126
TrampolineSym(SymbolRecordKind Kind)
Definition: SymbolRecord.h:91
std::vector< LocalVariableAddrGap > Gaps
Definition: SymbolRecord.h:471
Compile3Sym(uint32_t RecordOffset)
Definition: SymbolRecord.h:725
BuildInfoSym(SymbolRecordKind Kind)
Definition: SymbolRecord.h:872
DefRangeRegisterRelSym(SymbolRecordKind Kind)
Definition: SymbolRecord.h:553
BuildInfoSym(uint32_t RecordOffset)
Definition: SymbolRecord.h:873
CallSiteInfoSym(uint32_t RecordOffset)
Definition: SymbolRecord.h:799
ObjNameSym(SymbolRecordKind Kind)
Definition: SymbolRecord.h:641
uint32_t getRelocationOffset() const
Definition: SymbolRecord.h:602
ProcSym(SymbolRecordKind Kind)
Definition: SymbolRecord.h:45
StringRef - Represent a constant reference to a string, i.e.
Definition: StringRef.h:48
ProcSymFlags
Corresponds to the CV_PROCFLAGS bitfield.
Definition: CodeView.h:425
LocalSymFlags
Corresponds to CV_LVARFLAGS bitfield.
Definition: CodeView.h:398
CVRecord is a fat pointer (base + size pair) to a symbol or type record.
Definition: CVRecord.h:30
Annotations lets you mark points and ranges inside source code, for tests:
Definition: Annotations.h:46
Compile2Sym(SymbolRecordKind Kind)
Definition: SymbolRecord.h:698
DefRangeSubfieldRegisterSym(uint32_t RecordOffset)
Definition: SymbolRecord.h:509
FileStaticSym(uint32_t RecordOffset)
Definition: SymbolRecord.h:683
DefRangeSubfieldSym(uint32_t RecordOffset)
Definition: SymbolRecord.h:460
RegisterId decodeFramePtrReg(EncodedFramePtrReg EncodedReg, CPUType CPU)
CompileSym2Flags
Corresponds to COMPILESYM2::Flags bitfield.
Definition: CodeView.h:439
ExportSym(SymbolRecordKind Kind)
Definition: SymbolRecord.h:668
DefRangeSubfieldSym(SymbolRecordKind Kind)
Definition: SymbolRecord.h:459
SymbolRecord(SymbolRecordKind Kind)
Definition: SymbolRecord.h:31
bool empty() const
empty - Check if the array is empty.
Definition: ArrayRef.h:143
Compile2Sym(uint32_t RecordOffset)
Definition: SymbolRecord.h:699