LLVM  8.0.1
SymbolRecord.h
Go to the documentation of this file.
1 //===- SymbolRecord.h -------------------------------------------*- C++ -*-===//
2 //
3 // The LLVM Compiler Infrastructure
4 //
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9 
10 #ifndef LLVM_DEBUGINFO_CODEVIEW_SYMBOLRECORD_H
11 #define LLVM_DEBUGINFO_CODEVIEW_SYMBOLRECORD_H
12 
13 #include "llvm/ADT/APSInt.h"
14 #include "llvm/ADT/ArrayRef.h"
15 #include "llvm/ADT/Optional.h"
16 #include "llvm/ADT/StringRef.h"
23 #include "llvm/Support/Endian.h"
24 #include <cstdint>
25 #include <vector>
26 
27 namespace llvm {
28 namespace codeview {
29 
30 class SymbolRecord {
31 protected:
32  explicit SymbolRecord(SymbolRecordKind Kind) : Kind(Kind) {}
33 
34 public:
35  SymbolRecordKind getKind() const { return Kind; }
36 
38 };
39 
40 // S_GPROC32, S_LPROC32, S_GPROC32_ID, S_LPROC32_ID, S_LPROC32_DPC or
41 // S_LPROC32_DPC_ID
42 class ProcSym : public SymbolRecord {
43  static constexpr uint32_t RelocationOffset = 32;
44 
45 public:
48  : SymbolRecord(Kind), RecordOffset(RecordOffset) {}
49 
51  return RecordOffset + RelocationOffset;
52  }
53 
54  uint32_t Parent = 0;
55  uint32_t End = 0;
56  uint32_t Next = 0;
57  uint32_t CodeSize = 0;
58  uint32_t DbgStart = 0;
59  uint32_t DbgEnd = 0;
62  uint16_t Segment = 0;
65 
66  uint32_t RecordOffset = 0;
67 };
68 
69 // S_THUNK32
70 class Thunk32Sym : public SymbolRecord {
71 public:
74  : SymbolRecord(Kind), RecordOffset(RecordOffset) {}
75 
80  uint16_t Segment;
81  uint16_t Length;
85 
87 };
88 
89 // S_TRAMPOLINE
90 class TrampolineSym : public SymbolRecord {
91 public:
94  : SymbolRecord(Kind), RecordOffset(RecordOffset) {}
95 
97  uint16_t Size;
100  uint16_t ThunkSection;
101  uint16_t TargetSection;
102 
104 };
105 
106 // S_SECTION
107 class SectionSym : public SymbolRecord {
108 public:
111  : SymbolRecord(Kind), RecordOffset(RecordOffset) {}
112 
113  uint16_t SectionNumber;
114  uint8_t Alignment;
119 
121 };
122 
123 // S_COFFGROUP
124 class CoffGroupSym : public SymbolRecord {
125 public:
128  : SymbolRecord(Kind), RecordOffset(RecordOffset) {}
129 
133  uint16_t Segment;
135 
137 };
138 
139 class ScopeEndSym : public SymbolRecord {
140 public:
143  : SymbolRecord(Kind), RecordOffset(RecordOffset) {}
144 
146 };
147 
148 class CallerSym : public SymbolRecord {
149 public:
152  : SymbolRecord(Kind), RecordOffset(RecordOffset) {}
153 
154  std::vector<TypeIndex> Indices;
155 
157 };
158 
160  struct AnnotationData {
165  int32_t S1;
166  };
167 
168  BinaryAnnotationIterator() = default;
169  BinaryAnnotationIterator(ArrayRef<uint8_t> Annotations) : Data(Annotations) {}
171  : Data(Other.Data) {}
172 
174  return Data == Other.Data;
175  }
176 
178  return !(*this == Other);
179  }
180 
182  Data = Other.Data;
183  return *this;
184  }
185 
187  if (!ParseCurrentAnnotation()) {
188  *this = BinaryAnnotationIterator();
189  return *this;
190  }
191  Data = Next;
192  Next = ArrayRef<uint8_t>();
193  Current.reset();
194  return *this;
195  }
196 
198  BinaryAnnotationIterator Orig(*this);
199  ++(*this);
200  return Orig;
201  }
202 
204  ParseCurrentAnnotation();
205  return Current.getValue();
206  }
207 
208 private:
209  static uint32_t GetCompressedAnnotation(ArrayRef<uint8_t> &Annotations) {
210  if (Annotations.empty())
211  return -1;
212 
213  uint8_t FirstByte = Annotations.front();
214  Annotations = Annotations.drop_front();
215 
216  if ((FirstByte & 0x80) == 0x00)
217  return FirstByte;
218 
219  if (Annotations.empty())
220  return -1;
221 
222  uint8_t SecondByte = Annotations.front();
223  Annotations = Annotations.drop_front();
224 
225  if ((FirstByte & 0xC0) == 0x80)
226  return ((FirstByte & 0x3F) << 8) | SecondByte;
227 
228  if (Annotations.empty())
229  return -1;
230 
231  uint8_t ThirdByte = Annotations.front();
232  Annotations = Annotations.drop_front();
233 
234  if (Annotations.empty())
235  return -1;
236 
237  uint8_t FourthByte = Annotations.front();
238  Annotations = Annotations.drop_front();
239 
240  if ((FirstByte & 0xE0) == 0xC0)
241  return ((FirstByte & 0x1F) << 24) | (SecondByte << 16) |
242  (ThirdByte << 8) | FourthByte;
243 
244  return -1;
245  };
246 
247  static int32_t DecodeSignedOperand(uint32_t Operand) {
248  if (Operand & 1)
249  return -(Operand >> 1);
250  return Operand >> 1;
251  };
252 
253  static int32_t DecodeSignedOperand(ArrayRef<uint8_t> &Annotations) {
254  return DecodeSignedOperand(GetCompressedAnnotation(Annotations));
255  };
256 
257  bool ParseCurrentAnnotation() {
258  if (Current.hasValue())
259  return true;
260 
261  Next = Data;
262  uint32_t Op = GetCompressedAnnotation(Next);
263  AnnotationData Result;
264  Result.OpCode = static_cast<BinaryAnnotationsOpCode>(Op);
265  switch (Result.OpCode) {
267  Result.Name = "Invalid";
268  Next = ArrayRef<uint8_t>();
269  break;
271  Result.Name = "CodeOffset";
272  Result.U1 = GetCompressedAnnotation(Next);
273  break;
275  Result.Name = "ChangeCodeOffsetBase";
276  Result.U1 = GetCompressedAnnotation(Next);
277  break;
279  Result.Name = "ChangeCodeOffset";
280  Result.U1 = GetCompressedAnnotation(Next);
281  break;
283  Result.Name = "ChangeCodeLength";
284  Result.U1 = GetCompressedAnnotation(Next);
285  break;
287  Result.Name = "ChangeFile";
288  Result.U1 = GetCompressedAnnotation(Next);
289  break;
291  Result.Name = "ChangeLineEndDelta";
292  Result.U1 = GetCompressedAnnotation(Next);
293  break;
295  Result.Name = "ChangeRangeKind";
296  Result.U1 = GetCompressedAnnotation(Next);
297  break;
299  Result.Name = "ChangeColumnStart";
300  Result.U1 = GetCompressedAnnotation(Next);
301  break;
303  Result.Name = "ChangeColumnEnd";
304  Result.U1 = GetCompressedAnnotation(Next);
305  break;
307  Result.Name = "ChangeLineOffset";
308  Result.S1 = DecodeSignedOperand(Next);
309  break;
311  Result.Name = "ChangeColumnEndDelta";
312  Result.S1 = DecodeSignedOperand(Next);
313  break;
315  Result.Name = "ChangeCodeOffsetAndLineOffset";
316  uint32_t Annotation = GetCompressedAnnotation(Next);
317  Result.S1 = DecodeSignedOperand(Annotation >> 4);
318  Result.U1 = Annotation & 0xf;
319  break;
320  }
322  Result.Name = "ChangeCodeLengthAndCodeOffset";
323  Result.U1 = GetCompressedAnnotation(Next);
324  Result.U2 = GetCompressedAnnotation(Next);
325  break;
326  }
327  }
328  Current = Result;
329  return true;
330  }
331 
332  Optional<AnnotationData> Current;
334  ArrayRef<uint8_t> Next;
335 };
336 
337 // S_INLINESITE
338 class InlineSiteSym : public SymbolRecord {
339 public:
341  InlineSiteSym(uint32_t RecordOffset)
343  RecordOffset(RecordOffset) {}
344 
346  return make_range(BinaryAnnotationIterator(AnnotationData),
348  }
349 
353  std::vector<uint8_t> AnnotationData;
354 
356 };
357 
358 // S_PUB32
359 class PublicSym32 : public SymbolRecord {
360 public:
363  explicit PublicSym32(uint32_t RecordOffset)
365  RecordOffset(RecordOffset) {}
366 
369  uint16_t Segment = 0;
371 
372  uint32_t RecordOffset = 0;
373 };
374 
375 // S_REGISTER
376 class RegisterSym : public SymbolRecord {
377 public:
379  RegisterSym(uint32_t RecordOffset)
381  RecordOffset(RecordOffset) {}
382 
386 
388 };
389 
390 // S_PROCREF, S_LPROCREF
391 class ProcRefSym : public SymbolRecord {
392 public:
394  explicit ProcRefSym(uint32_t RecordOffset)
395  : SymbolRecord(SymbolRecordKind::ProcRefSym), RecordOffset(RecordOffset) {
396  }
397 
400  uint16_t Module;
402 
403  uint16_t modi() const { return Module - 1; }
405 };
406 
407 // S_LOCAL
408 class LocalSym : public SymbolRecord {
409 public:
411  explicit LocalSym(uint32_t RecordOffset)
412  : SymbolRecord(SymbolRecordKind::LocalSym), RecordOffset(RecordOffset) {}
413 
417 
419 };
420 
423  uint16_t ISectStart;
424  uint16_t Range;
425 };
426 
428  uint16_t GapStartOffset;
429  uint16_t Range;
430 };
431 
432 enum : uint16_t { MaxDefRange = 0xf000 };
433 
434 // S_DEFRANGE
435 class DefRangeSym : public SymbolRecord {
436  static constexpr uint32_t RelocationOffset = 8;
437 
438 public:
440  explicit DefRangeSym(uint32_t RecordOffset)
442  RecordOffset(RecordOffset) {}
443 
445  return RecordOffset + RelocationOffset;
446  }
447 
450  std::vector<LocalVariableAddrGap> Gaps;
451 
453 };
454 
455 // S_DEFRANGE_SUBFIELD
457  static constexpr uint32_t RelocationOffset = 12;
458 
459 public:
463  RecordOffset(RecordOffset) {}
464 
466  return RecordOffset + RelocationOffset;
467  }
468 
470  uint16_t OffsetInParent;
472  std::vector<LocalVariableAddrGap> Gaps;
473 
475 };
476 
477 // S_DEFRANGE_REGISTER
479 public:
480  struct Header {
483  };
484 
488  RecordOffset(RecordOffset) {}
489 
490  uint32_t getRelocationOffset() const { return RecordOffset + sizeof(Header); }
491 
494  std::vector<LocalVariableAddrGap> Gaps;
495 
497 };
498 
499 // S_DEFRANGE_SUBFIELD_REGISTER
501 public:
502  struct Header {
506  };
507 
509  : SymbolRecord(Kind) {}
512  RecordOffset(RecordOffset) {}
513 
514  uint32_t getRelocationOffset() const { return RecordOffset + sizeof(Header); }
515 
518  std::vector<LocalVariableAddrGap> Gaps;
519 
521 };
522 
523 // S_DEFRANGE_FRAMEPOINTER_REL
525  static constexpr uint32_t RelocationOffset = 8;
526 
527 public:
529  : SymbolRecord(Kind) {}
532  RecordOffset(RecordOffset) {}
533 
535  return RecordOffset + RelocationOffset;
536  }
537 
538  int32_t Offset;
540  std::vector<LocalVariableAddrGap> Gaps;
541 
543 };
544 
545 // S_DEFRANGE_REGISTER_REL
547 public:
548  struct Header {
552  };
553 
555  explicit DefRangeRegisterRelSym(uint32_t RecordOffset)
557  RecordOffset(RecordOffset) {}
558 
559  // The flags implement this notional bitfield:
560  // uint16_t IsSubfield : 1;
561  // uint16_t Padding : 3;
562  // uint16_t OffsetInParent : 12;
563  enum : uint16_t {
564  IsSubfieldFlag = 1,
565  OffsetInParentShift = 4,
566  };
567 
568  bool hasSpilledUDTMember() const { return Hdr.Flags & IsSubfieldFlag; }
569  uint16_t offsetInParent() const { return Hdr.Flags >> OffsetInParentShift; }
570 
571  uint32_t getRelocationOffset() const { return RecordOffset + sizeof(Header); }
572 
575  std::vector<LocalVariableAddrGap> Gaps;
576 
578 };
579 
580 // S_DEFRANGE_FRAMEPOINTER_REL_FULL_SCOPE
582 public:
584  : SymbolRecord(Kind) {}
587  RecordOffset(RecordOffset) {}
588 
589  int32_t Offset;
590 
592 };
593 
594 // S_BLOCK32
595 class BlockSym : public SymbolRecord {
596  static constexpr uint32_t RelocationOffset = 16;
597 
598 public:
600  explicit BlockSym(uint32_t RecordOffset)
601  : SymbolRecord(SymbolRecordKind::BlockSym), RecordOffset(RecordOffset) {}
602 
604  return RecordOffset + RelocationOffset;
605  }
606 
611  uint16_t Segment;
613 
615 };
616 
617 // S_LABEL32
618 class LabelSym : public SymbolRecord {
619  static constexpr uint32_t RelocationOffset = 4;
620 
621 public:
623  explicit LabelSym(uint32_t RecordOffset)
624  : SymbolRecord(SymbolRecordKind::LabelSym), RecordOffset(RecordOffset) {}
625 
627  return RecordOffset + RelocationOffset;
628  }
629 
631  uint16_t Segment;
634 
636 };
637 
638 // S_OBJNAME
639 class ObjNameSym : public SymbolRecord {
640 public:
643  ObjNameSym(uint32_t RecordOffset)
644  : SymbolRecord(SymbolRecordKind::ObjNameSym), RecordOffset(RecordOffset) {
645  }
646 
649 
651 };
652 
653 // S_ENVBLOCK
654 class EnvBlockSym : public SymbolRecord {
655 public:
657  EnvBlockSym(uint32_t RecordOffset)
659  RecordOffset(RecordOffset) {}
660 
661  std::vector<StringRef> Fields;
662 
664 };
665 
666 // S_EXPORT
667 class ExportSym : public SymbolRecord {
668 public:
670  ExportSym(uint32_t RecordOffset)
671  : SymbolRecord(SymbolRecordKind::ExportSym), RecordOffset(RecordOffset) {}
672 
673  uint16_t Ordinal;
676 
678 };
679 
680 // S_FILESTATIC
681 class FileStaticSym : public SymbolRecord {
682 public:
684  FileStaticSym(uint32_t RecordOffset)
686  RecordOffset(RecordOffset) {}
687 
692 
694 };
695 
696 // S_COMPILE2
697 class Compile2Sym : public SymbolRecord {
698 public:
700  Compile2Sym(uint32_t RecordOffset)
702  RecordOffset(RecordOffset) {}
703 
713  std::vector<StringRef> ExtraStrings;
714 
715  uint8_t getLanguage() const { return static_cast<uint32_t>(Flags) & 0xFF; }
716  uint32_t getFlags() const { return static_cast<uint32_t>(Flags) & ~0xFF; }
717 
719 };
720 
721 // S_COMPILE3
722 class Compile3Sym : public SymbolRecord {
723 public:
726  Compile3Sym(uint32_t RecordOffset)
728  RecordOffset(RecordOffset) {}
729 
741 
743  Flags = CompileSym3Flags((uint32_t(Flags) & 0xFFFFFF00) | uint32_t(Lang));
744  }
745 
747  return static_cast<SourceLanguage>(static_cast<uint32_t>(Flags) & 0xFF);
748  }
750  return static_cast<CompileSym3Flags>(static_cast<uint32_t>(Flags) & ~0xFF);
751  }
752 
753  bool hasOptimizations() const {
754  return CompileSym3Flags::None !=
756  }
757 
759 };
760 
761 // S_FRAMEPROC
762 class FrameProcSym : public SymbolRecord {
763 public:
765  explicit FrameProcSym(uint32_t RecordOffset)
767  RecordOffset(RecordOffset) {}
768 
776 
777  /// Extract the register this frame uses to refer to local variables.
779  return decodeFramePtrReg(
780  EncodedFramePtrReg((uint32_t(Flags) >> 14U) & 0x3U), CPU);
781  }
782 
783  /// Extract the register this frame uses to refer to parameters.
785  return decodeFramePtrReg(
786  EncodedFramePtrReg((uint32_t(Flags) >> 16U) & 0x3U), CPU);
787  }
788 
790 
791 private:
792 };
793 
794 // S_CALLSITEINFO
796  static constexpr uint32_t RelocationOffset = 4;
797 
798 public:
800  explicit CallSiteInfoSym(uint32_t RecordOffset)
802 
804  return RecordOffset + RelocationOffset;
805  }
806 
808  uint16_t Segment;
810 
812 };
813 
814 // S_HEAPALLOCSITE
816  static constexpr uint32_t RelocationOffset = 4;
817 
818 public:
820  explicit HeapAllocationSiteSym(uint32_t RecordOffset)
822  RecordOffset(RecordOffset) {}
823 
825  return RecordOffset + RelocationOffset;
826  }
827 
829  uint16_t Segment;
832 
834 };
835 
836 // S_FRAMECOOKIE
837 class FrameCookieSym : public SymbolRecord {
838  static constexpr uint32_t RelocationOffset = 4;
839 
840 public:
842  explicit FrameCookieSym(uint32_t RecordOffset)
844 
846  return RecordOffset + RelocationOffset;
847  }
848 
850  uint16_t Register;
852  uint8_t Flags;
853 
855 };
856 
857 // S_UDT, S_COBOLUDT
858 class UDTSym : public SymbolRecord {
859 public:
861  explicit UDTSym(uint32_t RecordOffset)
863 
866 
868 };
869 
870 // S_BUILDINFO
871 class BuildInfoSym : public SymbolRecord {
872 public:
874  BuildInfoSym(uint32_t RecordOffset)
876  RecordOffset(RecordOffset) {}
877 
879 
881 };
882 
883 // S_BPREL32
884 class BPRelativeSym : public SymbolRecord {
885 public:
887  explicit BPRelativeSym(uint32_t RecordOffset)
889  RecordOffset(RecordOffset) {}
890 
891  int32_t Offset;
894 
896 };
897 
898 // S_REGREL32
899 class RegRelativeSym : public SymbolRecord {
900 public:
902  explicit RegRelativeSym(uint32_t RecordOffset)
904  RecordOffset(RecordOffset) {}
905 
910 
912 };
913 
914 // S_CONSTANT, S_MANCONSTANT
915 class ConstantSym : public SymbolRecord {
916 public:
918  ConstantSym(uint32_t RecordOffset)
920  RecordOffset(RecordOffset) {}
921 
925 
927 };
928 
929 // S_LDATA32, S_GDATA32, S_LMANDATA, S_GMANDATA
930 class DataSym : public SymbolRecord {
931  static constexpr uint32_t RelocationOffset = 8;
932 
933 public:
935  DataSym(uint32_t RecordOffset)
936  : SymbolRecord(SymbolRecordKind::DataSym), RecordOffset(RecordOffset) {}
937 
939  return RecordOffset + RelocationOffset;
940  }
941 
944  uint16_t Segment;
946 
948 };
949 
950 // S_LTHREAD32, S_GTHREAD32
952  static constexpr uint32_t RelocationOffset = 8;
953 
954 public:
956  explicit ThreadLocalDataSym(uint32_t RecordOffset)
958  RecordOffset(RecordOffset) {}
959 
961  return RecordOffset + RelocationOffset;
962  }
963 
966  uint16_t Segment;
968 
970 };
971 
972 // S_UNAMESPACE
974 public:
976  explicit UsingNamespaceSym(uint32_t RecordOffset)
978  RecordOffset(RecordOffset) {}
979 
981 
983 };
984 
985 // S_ANNOTATION
986 
989 
991  uint32_t Offset);
992 
993 } // end namespace codeview
994 } // end namespace llvm
995 
996 #endif // LLVM_DEBUGINFO_CODEVIEW_SYMBOLRECORD_H
const T & front() const
front - Get the first element.
Definition: ArrayRef.h:152
DefRangeFramePointerRelSym(SymbolRecordKind Kind)
Definition: SymbolRecord.h:528
uint32_t getRelocationOffset() const
Definition: SymbolRecord.h:803
SymbolRecordKind
Distinguishes individual records in the Symbols subsection of a .debug$S section. ...
Definition: CodeView.h:41
This class represents lattice values for constants.
Definition: AllocatorList.h:24
uint32_t getRelocationOffset() const
Definition: SymbolRecord.h:845
ObjNameSym(uint32_t RecordOffset)
Definition: SymbolRecord.h:643
Thunk32Sym(SymbolRecordKind Kind, uint32_t RecordOffset)
Definition: SymbolRecord.h:73
CompileSym3Flags
Corresponds to COMPILESYM3::Flags bitfield.
Definition: CodeView.h:455
DefRangeSubfieldRegisterSym(SymbolRecordKind Kind)
Definition: SymbolRecord.h:508
UDTSym(SymbolRecordKind Kind)
Definition: SymbolRecord.h:860
BPRelativeSym(SymbolRecordKind Kind)
Definition: SymbolRecord.h:886
CompileSym3Flags getFlags() const
Definition: SymbolRecord.h:749
LocalSym(SymbolRecordKind Kind)
Definition: SymbolRecord.h:410
PublicSym32(SymbolRecordKind Kind)
Definition: SymbolRecord.h:362
FrameProcedureOptions Flags
Definition: SymbolRecord.h:775
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:975
bool operator!=(const BinaryAnnotationIterator &Other) const
Definition: SymbolRecord.h:177
ProcRefSym(uint32_t RecordOffset)
Definition: SymbolRecord.h:394
ScopeEndSym(SymbolRecordKind Kind)
Definition: SymbolRecord.h:141
detail::packed_endian_specific_integral< uint16_t, little, unaligned > ulittle16_t
Definition: Endian.h:269
BlockSym(uint32_t RecordOffset)
Definition: SymbolRecord.h:600
ConstantSym(uint32_t RecordOffset)
Definition: SymbolRecord.h:918
RegRelativeSym(SymbolRecordKind Kind)
Definition: SymbolRecord.h:901
ConstantSym(SymbolRecordKind Kind)
Definition: SymbolRecord.h:917
std::vector< LocalVariableAddrGap > Gaps
Definition: SymbolRecord.h:518
EnvBlockSym(SymbolRecordKind Kind)
Definition: SymbolRecord.h:656
ArrayRef< uint8_t > VariantData
Definition: SymbolRecord.h:84
void setLanguage(SourceLanguage Lang)
Definition: SymbolRecord.h:742
UDTSym(uint32_t RecordOffset)
Definition: SymbolRecord.h:861
CallerSym(SymbolRecordKind Kind, uint32_t RecordOffset)
Definition: SymbolRecord.h:151
std::vector< LocalVariableAddrGap > Gaps
Definition: SymbolRecord.h:575
std::vector< uint8_t > AnnotationData
Definition: SymbolRecord.h:353
DefRangeRegisterSym(uint32_t RecordOffset)
Definition: SymbolRecord.h:486
RegisterId getParamFramePtrReg(CPUType CPU) const
Extract the register this frame uses to refer to parameters.
Definition: SymbolRecord.h:784
ProcRefSym(SymbolRecordKind Kind)
Definition: SymbolRecord.h:393
Tagged union holding either a T or a Error.
Definition: CachePruning.h:23
ThreadLocalDataSym(uint32_t RecordOffset)
Definition: SymbolRecord.h:956
DefRangeRegisterRelSym(uint32_t RecordOffset)
Definition: SymbolRecord.h:555
LabelSym(SymbolRecordKind Kind)
Definition: SymbolRecord.h:622
uint8_t getLanguage() const
Definition: SymbolRecord.h:715
EnvBlockSym(uint32_t RecordOffset)
Definition: SymbolRecord.h:657
std::vector< StringRef > ExtraStrings
Definition: SymbolRecord.h:713
BinaryAnnotationIterator(const BinaryAnnotationIterator &Other)
Definition: SymbolRecord.h:170
PublicSymFlags
Corresponds to the CV_PUBSYMFLAGS bitfield.
Definition: CodeView.h:415
A 32-bit type reference.
Definition: TypeIndex.h:96
CallSiteInfoSym(SymbolRecordKind Kind)
Definition: SymbolRecord.h:799
RegisterSym(SymbolRecordKind Kind)
Definition: SymbolRecord.h:378
InlineSiteSym(uint32_t RecordOffset)
Definition: SymbolRecord.h:341
uint32_t getRelocationOffset() const
Definition: SymbolRecord.h:444
BinaryAnnotationIterator(ArrayRef< uint8_t > Annotations)
Definition: SymbolRecord.h:169
BlockSym(SymbolRecordKind Kind)
Definition: SymbolRecord.h:599
EncodedFramePtrReg
Two-bit value indicating which register is the designated frame pointer register. ...
Definition: CodeView.h:519
FrameCookieSym(SymbolRecordKind Kind)
Definition: SymbolRecord.h:841
DataSym(uint32_t RecordOffset)
Definition: SymbolRecord.h:935
std::vector< LocalVariableAddrGap > Gaps
Definition: SymbolRecord.h:494
ExportSym(uint32_t RecordOffset)
Definition: SymbolRecord.h:670
detail::packed_endian_specific_integral< uint32_t, little, unaligned > ulittle32_t
Definition: Endian.h:271
FrameProcSym(SymbolRecordKind Kind)
Definition: SymbolRecord.h:764
RegRelativeSym(uint32_t RecordOffset)
Definition: SymbolRecord.h:902
HeapAllocationSiteSym(uint32_t RecordOffset)
Definition: SymbolRecord.h:820
std::vector< StringRef > Fields
Definition: SymbolRecord.h:661
LocalVariableAddrRange Range
Definition: SymbolRecord.h:449
BPRelativeSym(uint32_t RecordOffset)
Definition: SymbolRecord.h:887
DefRangeSym(uint32_t RecordOffset)
Definition: SymbolRecord.h:440
DefRangeRegisterSym(SymbolRecordKind Kind)
Definition: SymbolRecord.h:485
BinaryAnnotationIterator operator++(int)
Definition: SymbolRecord.h:197
DataSym(SymbolRecordKind Kind)
Definition: SymbolRecord.h:934
uint32_t getFlags() const
Definition: SymbolRecord.h:716
SectionSym(SymbolRecordKind Kind, uint32_t RecordOffset)
Definition: SymbolRecord.h:110
std::vector< TypeIndex > Indices
Definition: SymbolRecord.h:154
const AnnotationData & operator*()
Definition: SymbolRecord.h:203
LocalVariableAddrRange Range
Definition: SymbolRecord.h:493
ProcSym(SymbolRecordKind Kind, uint32_t RecordOffset)
Definition: SymbolRecord.h:47
DefRangeSym(SymbolRecordKind Kind)
Definition: SymbolRecord.h:439
std::vector< LocalVariableAddrGap > Gaps
Definition: SymbolRecord.h:450
BinaryAnnotationIterator & operator=(const BinaryAnnotationIterator Other)
Definition: SymbolRecord.h:181
PublicSym32(uint32_t RecordOffset)
Definition: SymbolRecord.h:363
BinaryAnnotationIterator & operator++()
Definition: SymbolRecord.h:186
LocalVariableAddrRange Range
Definition: SymbolRecord.h:471
ThreadLocalDataSym(SymbolRecordKind Kind)
Definition: SymbolRecord.h:955
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:144
uint32_t getRelocationOffset() const
Definition: SymbolRecord.h:938
SymbolRecordKind getKind() const
Definition: SymbolRecord.h:35
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:79
TrampolineSym(SymbolRecordKind Kind, uint32_t RecordOffset)
Definition: SymbolRecord.h:93
Compile3Sym(SymbolRecordKind Kind)
Definition: SymbolRecord.h:725
FrameProcSym(uint32_t RecordOffset)
Definition: SymbolRecord.h:765
A range adaptor for a pair of iterators.
Thunk32Sym(SymbolRecordKind Kind)
Definition: SymbolRecord.h:72
FrameCookieSym(uint32_t RecordOffset)
Definition: SymbolRecord.h:842
ScopeEndSym(SymbolRecordKind Kind, uint32_t RecordOffset)
Definition: SymbolRecord.h:142
CoffGroupSym(SymbolRecordKind Kind)
Definition: SymbolRecord.h:126
bool operator==(BinaryAnnotationIterator Other) const
Definition: SymbolRecord.h:173
std::vector< LocalVariableAddrGap > Gaps
Definition: SymbolRecord.h:540
DefRangeFramePointerRelSym(uint32_t RecordOffset)
Definition: SymbolRecord.h:530
UsingNamespaceSym(uint32_t RecordOffset)
Definition: SymbolRecord.h:976
ArrayRef< T > drop_front(size_t N=1) const
Drop the first N elements of the array.
Definition: ArrayRef.h:188
SourceLanguage getLanguage() const
Definition: SymbolRecord.h:746
LabelSym(uint32_t RecordOffset)
Definition: SymbolRecord.h:623
detail::packed_endian_specific_integral< int32_t, little, unaligned > little32_t
Definition: Endian.h:278
HeapAllocationSiteSym(SymbolRecordKind Kind)
Definition: SymbolRecord.h:819
InlineSiteSym(SymbolRecordKind Kind)
Definition: SymbolRecord.h:340
SectionSym(SymbolRecordKind Kind)
Definition: SymbolRecord.h:109
uint32_t getRelocationOffset() const
Definition: SymbolRecord.h:50
CallerSym(SymbolRecordKind Kind)
Definition: SymbolRecord.h:150
LocalSym(uint32_t RecordOffset)
Definition: SymbolRecord.h:411
RegisterId getLocalFramePtrReg(CPUType CPU) const
Extract the register this frame uses to refer to local variables.
Definition: SymbolRecord.h:778
uint32_t getRelocationOffset() const
Definition: SymbolRecord.h:626
FileStaticSym(SymbolRecordKind Kind)
Definition: SymbolRecord.h:683
ThunkOrdinal
These values correspond to the THUNK_ORDINAL enumeration.
Definition: CodeView.h:531
RegisterSym(uint32_t RecordOffset)
Definition: SymbolRecord.h:379
iterator_range< BinaryAnnotationIterator > annotations() const
Definition: SymbolRecord.h:345
CoffGroupSym(SymbolRecordKind Kind, uint32_t RecordOffset)
Definition: SymbolRecord.h:127
TrampolineSym(SymbolRecordKind Kind)
Definition: SymbolRecord.h:92
std::vector< LocalVariableAddrGap > Gaps
Definition: SymbolRecord.h:472
Compile3Sym(uint32_t RecordOffset)
Definition: SymbolRecord.h:726
BuildInfoSym(SymbolRecordKind Kind)
Definition: SymbolRecord.h:873
DefRangeRegisterRelSym(SymbolRecordKind Kind)
Definition: SymbolRecord.h:554
BuildInfoSym(uint32_t RecordOffset)
Definition: SymbolRecord.h:874
CallSiteInfoSym(uint32_t RecordOffset)
Definition: SymbolRecord.h:800
ObjNameSym(SymbolRecordKind Kind)
Definition: SymbolRecord.h:642
uint32_t getRelocationOffset() const
Definition: SymbolRecord.h:603
ProcSym(SymbolRecordKind Kind)
Definition: SymbolRecord.h:46
StringRef - Represent a constant reference to a string, i.e.
Definition: StringRef.h:49
ProcSymFlags
Corresponds to the CV_PROCFLAGS bitfield.
Definition: CodeView.h:425
LocalSymFlags
Corresponds to CV_LVARFLAGS bitfield.
Definition: CodeView.h:398
Compile2Sym(SymbolRecordKind Kind)
Definition: SymbolRecord.h:699
DefRangeSubfieldRegisterSym(uint32_t RecordOffset)
Definition: SymbolRecord.h:510
FileStaticSym(uint32_t RecordOffset)
Definition: SymbolRecord.h:684
DefRangeSubfieldSym(uint32_t RecordOffset)
Definition: SymbolRecord.h:461
RegisterId decodeFramePtrReg(EncodedFramePtrReg EncodedReg, CPUType CPU)
CompileSym2Flags
Corresponds to COMPILESYM2::Flags bitfield.
Definition: CodeView.h:439
ExportSym(SymbolRecordKind Kind)
Definition: SymbolRecord.h:669
DefRangeSubfieldSym(SymbolRecordKind Kind)
Definition: SymbolRecord.h:460
SymbolRecord(SymbolRecordKind Kind)
Definition: SymbolRecord.h:32
bool empty() const
empty - Check if the array is empty.
Definition: ArrayRef.h:144
Compile2Sym(uint32_t RecordOffset)
Definition: SymbolRecord.h:700