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"
16 #include "llvm/ADT/iterator.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 
163  uint32_t U1 = 0;
164  uint32_t U2 = 0;
165  int32_t S1 = 0;
166 };
167 
169  : public iterator_facade_base<BinaryAnnotationIterator,
170  std::forward_iterator_tag,
171  DecodedAnnotation> {
172  BinaryAnnotationIterator() = default;
175  : Data(Other.Data) {}
176 
178  return Data == Other.Data;
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  ParseCurrentAnnotation();
199  return Current.getValue();
200  }
201 
202 private:
203  static uint32_t GetCompressedAnnotation(ArrayRef<uint8_t> &Annotations) {
204  if (Annotations.empty())
205  return -1;
206 
207  uint8_t FirstByte = Annotations.front();
208  Annotations = Annotations.drop_front();
209 
210  if ((FirstByte & 0x80) == 0x00)
211  return FirstByte;
212 
213  if (Annotations.empty())
214  return -1;
215 
216  uint8_t SecondByte = Annotations.front();
217  Annotations = Annotations.drop_front();
218 
219  if ((FirstByte & 0xC0) == 0x80)
220  return ((FirstByte & 0x3F) << 8) | SecondByte;
221 
222  if (Annotations.empty())
223  return -1;
224 
225  uint8_t ThirdByte = Annotations.front();
226  Annotations = Annotations.drop_front();
227 
228  if (Annotations.empty())
229  return -1;
230 
231  uint8_t FourthByte = Annotations.front();
232  Annotations = Annotations.drop_front();
233 
234  if ((FirstByte & 0xE0) == 0xC0)
235  return ((FirstByte & 0x1F) << 24) | (SecondByte << 16) |
236  (ThirdByte << 8) | FourthByte;
237 
238  return -1;
239  }
240 
241  static int32_t DecodeSignedOperand(uint32_t Operand) {
242  if (Operand & 1)
243  return -(Operand >> 1);
244  return Operand >> 1;
245  }
246 
247  static int32_t DecodeSignedOperand(ArrayRef<uint8_t> &Annotations) {
248  return DecodeSignedOperand(GetCompressedAnnotation(Annotations));
249  }
250 
251  bool ParseCurrentAnnotation() {
252  if (Current.hasValue())
253  return true;
254 
255  Next = Data;
256  uint32_t Op = GetCompressedAnnotation(Next);
257  DecodedAnnotation Result;
258  Result.OpCode = static_cast<BinaryAnnotationsOpCode>(Op);
259  switch (Result.OpCode) {
261  Result.Name = "Invalid";
262  Next = ArrayRef<uint8_t>();
263  break;
265  Result.Name = "CodeOffset";
266  Result.U1 = GetCompressedAnnotation(Next);
267  break;
269  Result.Name = "ChangeCodeOffsetBase";
270  Result.U1 = GetCompressedAnnotation(Next);
271  break;
273  Result.Name = "ChangeCodeOffset";
274  Result.U1 = GetCompressedAnnotation(Next);
275  break;
277  Result.Name = "ChangeCodeLength";
278  Result.U1 = GetCompressedAnnotation(Next);
279  break;
281  Result.Name = "ChangeFile";
282  Result.U1 = GetCompressedAnnotation(Next);
283  break;
285  Result.Name = "ChangeLineEndDelta";
286  Result.U1 = GetCompressedAnnotation(Next);
287  break;
289  Result.Name = "ChangeRangeKind";
290  Result.U1 = GetCompressedAnnotation(Next);
291  break;
293  Result.Name = "ChangeColumnStart";
294  Result.U1 = GetCompressedAnnotation(Next);
295  break;
297  Result.Name = "ChangeColumnEnd";
298  Result.U1 = GetCompressedAnnotation(Next);
299  break;
301  Result.Name = "ChangeLineOffset";
302  Result.S1 = DecodeSignedOperand(Next);
303  break;
305  Result.Name = "ChangeColumnEndDelta";
306  Result.S1 = DecodeSignedOperand(Next);
307  break;
309  Result.Name = "ChangeCodeOffsetAndLineOffset";
310  uint32_t Annotation = GetCompressedAnnotation(Next);
311  Result.S1 = DecodeSignedOperand(Annotation >> 4);
312  Result.U1 = Annotation & 0xf;
313  break;
314  }
316  Result.Name = "ChangeCodeLengthAndCodeOffset";
317  Result.U1 = GetCompressedAnnotation(Next);
318  Result.U2 = GetCompressedAnnotation(Next);
319  break;
320  }
321  }
322  Result.Bytes = Data.take_front(Data.size() - Next.size());
323  Current = Result;
324  return true;
325  }
326 
329  ArrayRef<uint8_t> Next;
330 };
331 
332 // S_INLINESITE
333 class InlineSiteSym : public SymbolRecord {
334 public:
336  InlineSiteSym(uint32_t RecordOffset)
338  RecordOffset(RecordOffset) {}
339 
341  return make_range(BinaryAnnotationIterator(AnnotationData),
343  }
344 
348  std::vector<uint8_t> AnnotationData;
349 
351 };
352 
353 // S_PUB32
354 class PublicSym32 : public SymbolRecord {
355 public:
358  explicit PublicSym32(uint32_t RecordOffset)
360  RecordOffset(RecordOffset) {}
361 
364  uint16_t Segment = 0;
366 
367  uint32_t RecordOffset = 0;
368 };
369 
370 // S_REGISTER
371 class RegisterSym : public SymbolRecord {
372 public:
374  RegisterSym(uint32_t RecordOffset)
376  RecordOffset(RecordOffset) {}
377 
381 
383 };
384 
385 // S_PROCREF, S_LPROCREF
386 class ProcRefSym : public SymbolRecord {
387 public:
389  explicit ProcRefSym(uint32_t RecordOffset)
390  : SymbolRecord(SymbolRecordKind::ProcRefSym), RecordOffset(RecordOffset) {
391  }
392 
395  uint16_t Module;
397 
398  uint16_t modi() const { return Module - 1; }
400 };
401 
402 // S_LOCAL
403 class LocalSym : public SymbolRecord {
404 public:
406  explicit LocalSym(uint32_t RecordOffset)
407  : SymbolRecord(SymbolRecordKind::LocalSym), RecordOffset(RecordOffset) {}
408 
412 
414 };
415 
418  uint16_t ISectStart;
419  uint16_t Range;
420 };
421 
423  uint16_t GapStartOffset;
424  uint16_t Range;
425 };
426 
427 enum : uint16_t { MaxDefRange = 0xf000 };
428 
429 // S_DEFRANGE
430 class DefRangeSym : public SymbolRecord {
431  static constexpr uint32_t RelocationOffset = 8;
432 
433 public:
435  explicit DefRangeSym(uint32_t RecordOffset)
437  RecordOffset(RecordOffset) {}
438 
440  return RecordOffset + RelocationOffset;
441  }
442 
445  std::vector<LocalVariableAddrGap> Gaps;
446 
448 };
449 
450 // S_DEFRANGE_SUBFIELD
452  static constexpr uint32_t RelocationOffset = 12;
453 
454 public:
458  RecordOffset(RecordOffset) {}
459 
461  return RecordOffset + RelocationOffset;
462  }
463 
465  uint16_t OffsetInParent;
467  std::vector<LocalVariableAddrGap> Gaps;
468 
470 };
471 
472 // S_DEFRANGE_REGISTER
474 public:
475  struct Header {
478  };
479 
483  RecordOffset(RecordOffset) {}
484 
485  uint32_t getRelocationOffset() const { return RecordOffset + sizeof(Header); }
486 
489  std::vector<LocalVariableAddrGap> Gaps;
490 
492 };
493 
494 // S_DEFRANGE_SUBFIELD_REGISTER
496 public:
497  struct Header {
501  };
502 
504  : SymbolRecord(Kind) {}
507  RecordOffset(RecordOffset) {}
508 
509  uint32_t getRelocationOffset() const { return RecordOffset + sizeof(Header); }
510 
513  std::vector<LocalVariableAddrGap> Gaps;
514 
516 };
517 
518 // S_DEFRANGE_FRAMEPOINTER_REL
520  static constexpr uint32_t RelocationOffset = 8;
521 
522 public:
524  : SymbolRecord(Kind) {}
527  RecordOffset(RecordOffset) {}
528 
530  return RecordOffset + RelocationOffset;
531  }
532 
533  int32_t Offset;
535  std::vector<LocalVariableAddrGap> Gaps;
536 
538 };
539 
540 // S_DEFRANGE_REGISTER_REL
542 public:
543  struct Header {
547  };
548 
550  explicit DefRangeRegisterRelSym(uint32_t RecordOffset)
552  RecordOffset(RecordOffset) {}
553 
554  // The flags implement this notional bitfield:
555  // uint16_t IsSubfield : 1;
556  // uint16_t Padding : 3;
557  // uint16_t OffsetInParent : 12;
558  enum : uint16_t {
559  IsSubfieldFlag = 1,
560  OffsetInParentShift = 4,
561  };
562 
563  bool hasSpilledUDTMember() const { return Hdr.Flags & IsSubfieldFlag; }
564  uint16_t offsetInParent() const { return Hdr.Flags >> OffsetInParentShift; }
565 
566  uint32_t getRelocationOffset() const { return RecordOffset + sizeof(Header); }
567 
570  std::vector<LocalVariableAddrGap> Gaps;
571 
573 };
574 
575 // S_DEFRANGE_FRAMEPOINTER_REL_FULL_SCOPE
577 public:
579  : SymbolRecord(Kind) {}
582  RecordOffset(RecordOffset) {}
583 
584  int32_t Offset;
585 
587 };
588 
589 // S_BLOCK32
590 class BlockSym : public SymbolRecord {
591  static constexpr uint32_t RelocationOffset = 16;
592 
593 public:
595  explicit BlockSym(uint32_t RecordOffset)
596  : SymbolRecord(SymbolRecordKind::BlockSym), RecordOffset(RecordOffset) {}
597 
599  return RecordOffset + RelocationOffset;
600  }
601 
606  uint16_t Segment;
608 
610 };
611 
612 // S_LABEL32
613 class LabelSym : public SymbolRecord {
614  static constexpr uint32_t RelocationOffset = 4;
615 
616 public:
618  explicit LabelSym(uint32_t RecordOffset)
619  : SymbolRecord(SymbolRecordKind::LabelSym), RecordOffset(RecordOffset) {}
620 
622  return RecordOffset + RelocationOffset;
623  }
624 
626  uint16_t Segment;
629 
631 };
632 
633 // S_OBJNAME
634 class ObjNameSym : public SymbolRecord {
635 public:
638  ObjNameSym(uint32_t RecordOffset)
639  : SymbolRecord(SymbolRecordKind::ObjNameSym), RecordOffset(RecordOffset) {
640  }
641 
644 
646 };
647 
648 // S_ENVBLOCK
649 class EnvBlockSym : public SymbolRecord {
650 public:
652  EnvBlockSym(uint32_t RecordOffset)
654  RecordOffset(RecordOffset) {}
655 
656  std::vector<StringRef> Fields;
657 
659 };
660 
661 // S_EXPORT
662 class ExportSym : public SymbolRecord {
663 public:
665  ExportSym(uint32_t RecordOffset)
666  : SymbolRecord(SymbolRecordKind::ExportSym), RecordOffset(RecordOffset) {}
667 
668  uint16_t Ordinal;
671 
673 };
674 
675 // S_FILESTATIC
676 class FileStaticSym : public SymbolRecord {
677 public:
679  FileStaticSym(uint32_t RecordOffset)
681  RecordOffset(RecordOffset) {}
682 
687 
689 };
690 
691 // S_COMPILE2
692 class Compile2Sym : public SymbolRecord {
693 public:
695  Compile2Sym(uint32_t RecordOffset)
697  RecordOffset(RecordOffset) {}
698 
708  std::vector<StringRef> ExtraStrings;
709 
710  uint8_t getLanguage() const { return static_cast<uint32_t>(Flags) & 0xFF; }
711  uint32_t getFlags() const { return static_cast<uint32_t>(Flags) & ~0xFF; }
712 
714 };
715 
716 // S_COMPILE3
717 class Compile3Sym : public SymbolRecord {
718 public:
721  Compile3Sym(uint32_t RecordOffset)
723  RecordOffset(RecordOffset) {}
724 
736 
738  Flags = CompileSym3Flags((uint32_t(Flags) & 0xFFFFFF00) | uint32_t(Lang));
739  }
740 
742  return static_cast<SourceLanguage>(static_cast<uint32_t>(Flags) & 0xFF);
743  }
745  return static_cast<CompileSym3Flags>(static_cast<uint32_t>(Flags) & ~0xFF);
746  }
747 
748  bool hasOptimizations() const {
749  return CompileSym3Flags::None !=
751  }
752 
754 };
755 
756 // S_FRAMEPROC
757 class FrameProcSym : public SymbolRecord {
758 public:
760  explicit FrameProcSym(uint32_t RecordOffset)
762  RecordOffset(RecordOffset) {}
763 
771 
772  /// Extract the register this frame uses to refer to local variables.
774  return decodeFramePtrReg(
775  EncodedFramePtrReg((uint32_t(Flags) >> 14U) & 0x3U), CPU);
776  }
777 
778  /// Extract the register this frame uses to refer to parameters.
780  return decodeFramePtrReg(
781  EncodedFramePtrReg((uint32_t(Flags) >> 16U) & 0x3U), CPU);
782  }
783 
785 
786 private:
787 };
788 
789 // S_CALLSITEINFO
791  static constexpr uint32_t RelocationOffset = 4;
792 
793 public:
795  explicit CallSiteInfoSym(uint32_t RecordOffset)
797 
799  return RecordOffset + RelocationOffset;
800  }
801 
803  uint16_t Segment;
805 
807 };
808 
809 // S_HEAPALLOCSITE
811  static constexpr uint32_t RelocationOffset = 4;
812 
813 public:
815  explicit HeapAllocationSiteSym(uint32_t RecordOffset)
817  RecordOffset(RecordOffset) {}
818 
820  return RecordOffset + RelocationOffset;
821  }
822 
824  uint16_t Segment;
827 
829 };
830 
831 // S_FRAMECOOKIE
832 class FrameCookieSym : public SymbolRecord {
833  static constexpr uint32_t RelocationOffset = 4;
834 
835 public:
837  explicit FrameCookieSym(uint32_t RecordOffset)
839 
841  return RecordOffset + RelocationOffset;
842  }
843 
845  uint16_t Register;
847  uint8_t Flags;
848 
850 };
851 
852 // S_UDT, S_COBOLUDT
853 class UDTSym : public SymbolRecord {
854 public:
856  explicit UDTSym(uint32_t RecordOffset)
858 
861 
863 };
864 
865 // S_BUILDINFO
866 class BuildInfoSym : public SymbolRecord {
867 public:
869  BuildInfoSym(uint32_t RecordOffset)
871  RecordOffset(RecordOffset) {}
872 
874 
876 };
877 
878 // S_BPREL32
879 class BPRelativeSym : public SymbolRecord {
880 public:
882  explicit BPRelativeSym(uint32_t RecordOffset)
884  RecordOffset(RecordOffset) {}
885 
886  int32_t Offset;
889 
891 };
892 
893 // S_REGREL32
894 class RegRelativeSym : public SymbolRecord {
895 public:
897  explicit RegRelativeSym(uint32_t RecordOffset)
899  RecordOffset(RecordOffset) {}
900 
905 
907 };
908 
909 // S_CONSTANT, S_MANCONSTANT
910 class ConstantSym : public SymbolRecord {
911 public:
913  ConstantSym(uint32_t RecordOffset)
915  RecordOffset(RecordOffset) {}
916 
920 
922 };
923 
924 // S_LDATA32, S_GDATA32, S_LMANDATA, S_GMANDATA
925 class DataSym : public SymbolRecord {
926  static constexpr uint32_t RelocationOffset = 8;
927 
928 public:
930  DataSym(uint32_t RecordOffset)
931  : SymbolRecord(SymbolRecordKind::DataSym), RecordOffset(RecordOffset) {}
932 
934  return RecordOffset + RelocationOffset;
935  }
936 
939  uint16_t Segment;
941 
943 };
944 
945 // S_LTHREAD32, S_GTHREAD32
947  static constexpr uint32_t RelocationOffset = 8;
948 
949 public:
951  explicit ThreadLocalDataSym(uint32_t RecordOffset)
953  RecordOffset(RecordOffset) {}
954 
956  return RecordOffset + RelocationOffset;
957  }
958 
961  uint16_t Segment;
963 
965 };
966 
967 // S_UNAMESPACE
969 public:
971  explicit UsingNamespaceSym(uint32_t RecordOffset)
973  RecordOffset(RecordOffset) {}
974 
976 
978 };
979 
980 // S_ANNOTATION
981 class AnnotationSym : public SymbolRecord {
982 public:
984  explicit AnnotationSym(uint32_t RecordOffset)
986  RecordOffset(RecordOffset) {}
987 
989  uint16_t Segment = 0;
990  std::vector<StringRef> Strings;
991 
993 };
994 
997 
999  uint32_t Offset);
1000 
1001 } // end namespace codeview
1002 } // end namespace llvm
1003 
1004 #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:523
uint32_t getRelocationOffset() const
Definition: SymbolRecord.h:798
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:840
ObjNameSym(uint32_t RecordOffset)
Definition: SymbolRecord.h:638
Thunk32Sym(SymbolRecordKind Kind, uint32_t RecordOffset)
Definition: SymbolRecord.h:73
CompileSym3Flags
Corresponds to COMPILESYM3::Flags bitfield.
Definition: CodeView.h:458
DefRangeSubfieldRegisterSym(SymbolRecordKind Kind)
Definition: SymbolRecord.h:503
UDTSym(SymbolRecordKind Kind)
Definition: SymbolRecord.h:855
BPRelativeSym(SymbolRecordKind Kind)
Definition: SymbolRecord.h:881
CompileSym3Flags getFlags() const
Definition: SymbolRecord.h:744
LocalSym(SymbolRecordKind Kind)
Definition: SymbolRecord.h:405
PublicSym32(SymbolRecordKind Kind)
Definition: SymbolRecord.h:357
FrameProcedureOptions Flags
Definition: SymbolRecord.h:770
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:970
ProcRefSym(uint32_t RecordOffset)
Definition: SymbolRecord.h:389
ScopeEndSym(SymbolRecordKind Kind)
Definition: SymbolRecord.h:141
detail::packed_endian_specific_integral< uint16_t, little, unaligned > ulittle16_t
Definition: Endian.h:272
BlockSym(uint32_t RecordOffset)
Definition: SymbolRecord.h:595
BinaryAnnotationsOpCode OpCode
Definition: SymbolRecord.h:162
ConstantSym(uint32_t RecordOffset)
Definition: SymbolRecord.h:913
RegRelativeSym(SymbolRecordKind Kind)
Definition: SymbolRecord.h:896
ConstantSym(SymbolRecordKind Kind)
Definition: SymbolRecord.h:912
std::vector< LocalVariableAddrGap > Gaps
Definition: SymbolRecord.h:513
EnvBlockSym(SymbolRecordKind Kind)
Definition: SymbolRecord.h:651
ArrayRef< uint8_t > VariantData
Definition: SymbolRecord.h:84
void setLanguage(SourceLanguage Lang)
Definition: SymbolRecord.h:737
UDTSym(uint32_t RecordOffset)
Definition: SymbolRecord.h:856
CallerSym(SymbolRecordKind Kind, uint32_t RecordOffset)
Definition: SymbolRecord.h:151
std::vector< LocalVariableAddrGap > Gaps
Definition: SymbolRecord.h:570
std::vector< uint8_t > AnnotationData
Definition: SymbolRecord.h:348
DefRangeRegisterSym(uint32_t RecordOffset)
Definition: SymbolRecord.h:481
RegisterId getParamFramePtrReg(CPUType CPU) const
Extract the register this frame uses to refer to parameters.
Definition: SymbolRecord.h:779
ProcRefSym(SymbolRecordKind Kind)
Definition: SymbolRecord.h:388
Tagged union holding either a T or a Error.
Definition: CachePruning.h:22
ThreadLocalDataSym(uint32_t RecordOffset)
Definition: SymbolRecord.h:951
DefRangeRegisterRelSym(uint32_t RecordOffset)
Definition: SymbolRecord.h:550
AnnotationSym(uint32_t RecordOffset)
Definition: SymbolRecord.h:984
LabelSym(SymbolRecordKind Kind)
Definition: SymbolRecord.h:617
uint8_t getLanguage() const
Definition: SymbolRecord.h:710
EnvBlockSym(uint32_t RecordOffset)
Definition: SymbolRecord.h:652
std::vector< StringRef > ExtraStrings
Definition: SymbolRecord.h:708
BinaryAnnotationIterator(const BinaryAnnotationIterator &Other)
Definition: SymbolRecord.h:174
PublicSymFlags
Corresponds to the CV_PUBSYMFLAGS bitfield.
Definition: CodeView.h:418
A 32-bit type reference.
Definition: TypeIndex.h:95
CallSiteInfoSym(SymbolRecordKind Kind)
Definition: SymbolRecord.h:794
CRTP base class which implements the entire standard iterator facade in terms of a minimal subset of ...
Definition: iterator.h:67
RegisterSym(SymbolRecordKind Kind)
Definition: SymbolRecord.h:373
InlineSiteSym(uint32_t RecordOffset)
Definition: SymbolRecord.h:336
uint32_t getRelocationOffset() const
Definition: SymbolRecord.h:439
BinaryAnnotationIterator(ArrayRef< uint8_t > Annotations)
Definition: SymbolRecord.h:173
BlockSym(SymbolRecordKind Kind)
Definition: SymbolRecord.h:594
EncodedFramePtrReg
Two-bit value indicating which register is the designated frame pointer register. ...
Definition: CodeView.h:536
FrameCookieSym(SymbolRecordKind Kind)
Definition: SymbolRecord.h:836
DataSym(uint32_t RecordOffset)
Definition: SymbolRecord.h:930
std::vector< LocalVariableAddrGap > Gaps
Definition: SymbolRecord.h:489
ExportSym(uint32_t RecordOffset)
Definition: SymbolRecord.h:665
detail::packed_endian_specific_integral< uint32_t, little, unaligned > ulittle32_t
Definition: Endian.h:274
FrameProcSym(SymbolRecordKind Kind)
Definition: SymbolRecord.h:759
RegRelativeSym(uint32_t RecordOffset)
Definition: SymbolRecord.h:897
HeapAllocationSiteSym(uint32_t RecordOffset)
Definition: SymbolRecord.h:815
std::vector< StringRef > Fields
Definition: SymbolRecord.h:656
AnnotationSym(SymbolRecordKind Kind)
Definition: SymbolRecord.h:983
LocalVariableAddrRange Range
Definition: SymbolRecord.h:444
BPRelativeSym(uint32_t RecordOffset)
Definition: SymbolRecord.h:882
DefRangeSym(uint32_t RecordOffset)
Definition: SymbolRecord.h:435
DefRangeRegisterSym(SymbolRecordKind Kind)
Definition: SymbolRecord.h:480
DataSym(SymbolRecordKind Kind)
Definition: SymbolRecord.h:929
uint32_t getFlags() const
Definition: SymbolRecord.h:711
SectionSym(SymbolRecordKind Kind, uint32_t RecordOffset)
Definition: SymbolRecord.h:110
std::vector< TypeIndex > Indices
Definition: SymbolRecord.h:154
LocalVariableAddrRange Range
Definition: SymbolRecord.h:488
ProcSym(SymbolRecordKind Kind, uint32_t RecordOffset)
Definition: SymbolRecord.h:47
DefRangeSym(SymbolRecordKind Kind)
Definition: SymbolRecord.h:434
std::vector< LocalVariableAddrGap > Gaps
Definition: SymbolRecord.h:445
BinaryAnnotationIterator & operator=(const BinaryAnnotationIterator Other)
Definition: SymbolRecord.h:181
PublicSym32(uint32_t RecordOffset)
Definition: SymbolRecord.h:358
BinaryAnnotationIterator & operator++()
Definition: SymbolRecord.h:186
LocalVariableAddrRange Range
Definition: SymbolRecord.h:466
const DecodedAnnotation & operator*()
Definition: SymbolRecord.h:197
ThreadLocalDataSym(SymbolRecordKind Kind)
Definition: SymbolRecord.h:950
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:933
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:78
std::vector< StringRef > Strings
Definition: SymbolRecord.h:990
TrampolineSym(SymbolRecordKind Kind, uint32_t RecordOffset)
Definition: SymbolRecord.h:93
Compile3Sym(SymbolRecordKind Kind)
Definition: SymbolRecord.h:720
FrameProcSym(uint32_t RecordOffset)
Definition: SymbolRecord.h:760
A range adaptor for a pair of iterators.
Thunk32Sym(SymbolRecordKind Kind)
Definition: SymbolRecord.h:72
FrameCookieSym(uint32_t RecordOffset)
Definition: SymbolRecord.h:837
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:177
std::vector< LocalVariableAddrGap > Gaps
Definition: SymbolRecord.h:535
DefRangeFramePointerRelSym(uint32_t RecordOffset)
Definition: SymbolRecord.h:525
UsingNamespaceSym(uint32_t RecordOffset)
Definition: SymbolRecord.h:971
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:741
LabelSym(uint32_t RecordOffset)
Definition: SymbolRecord.h:618
detail::packed_endian_specific_integral< int32_t, little, unaligned > little32_t
Definition: Endian.h:281
HeapAllocationSiteSym(SymbolRecordKind Kind)
Definition: SymbolRecord.h:814
InlineSiteSym(SymbolRecordKind Kind)
Definition: SymbolRecord.h:335
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:406
RegisterId getLocalFramePtrReg(CPUType CPU) const
Extract the register this frame uses to refer to local variables.
Definition: SymbolRecord.h:773
uint32_t getRelocationOffset() const
Definition: SymbolRecord.h:621
FileStaticSym(SymbolRecordKind Kind)
Definition: SymbolRecord.h:678
ThunkOrdinal
These values correspond to the THUNK_ORDINAL enumeration.
Definition: CodeView.h:548
RegisterSym(uint32_t RecordOffset)
Definition: SymbolRecord.h:374
iterator_range< BinaryAnnotationIterator > annotations() const
Definition: SymbolRecord.h:340
CoffGroupSym(SymbolRecordKind Kind, uint32_t RecordOffset)
Definition: SymbolRecord.h:127
TrampolineSym(SymbolRecordKind Kind)
Definition: SymbolRecord.h:92
std::vector< LocalVariableAddrGap > Gaps
Definition: SymbolRecord.h:467
Compile3Sym(uint32_t RecordOffset)
Definition: SymbolRecord.h:721
BuildInfoSym(SymbolRecordKind Kind)
Definition: SymbolRecord.h:868
DefRangeRegisterRelSym(SymbolRecordKind Kind)
Definition: SymbolRecord.h:549
BuildInfoSym(uint32_t RecordOffset)
Definition: SymbolRecord.h:869
CallSiteInfoSym(uint32_t RecordOffset)
Definition: SymbolRecord.h:795
ObjNameSym(SymbolRecordKind Kind)
Definition: SymbolRecord.h:637
uint32_t getRelocationOffset() const
Definition: SymbolRecord.h:598
ProcSym(SymbolRecordKind Kind)
Definition: SymbolRecord.h:46
StringRef - Represent a constant reference to a string, i.e.
Definition: StringRef.h:48
ProcSymFlags
Corresponds to the CV_PROCFLAGS bitfield.
Definition: CodeView.h:428
LocalSymFlags
Corresponds to CV_LVARFLAGS bitfield.
Definition: CodeView.h:401
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:694
DefRangeSubfieldRegisterSym(uint32_t RecordOffset)
Definition: SymbolRecord.h:505
FileStaticSym(uint32_t RecordOffset)
Definition: SymbolRecord.h:679
DefRangeSubfieldSym(uint32_t RecordOffset)
Definition: SymbolRecord.h:456
RegisterId decodeFramePtrReg(EncodedFramePtrReg EncodedReg, CPUType CPU)
CompileSym2Flags
Corresponds to COMPILESYM2::Flags bitfield.
Definition: CodeView.h:442
ExportSym(SymbolRecordKind Kind)
Definition: SymbolRecord.h:664
DefRangeSubfieldSym(SymbolRecordKind Kind)
Definition: SymbolRecord.h:455
SymbolRecord(SymbolRecordKind Kind)
Definition: SymbolRecord.h:32
bool empty() const
empty - Check if the array is empty.
Definition: ArrayRef.h:143
Compile2Sym(uint32_t RecordOffset)
Definition: SymbolRecord.h:695