LLVM  9.0.0svn
SymbolDumper.cpp
Go to the documentation of this file.
1 //===-- SymbolDumper.cpp - CodeView symbol info dumper ----------*- 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 
10 #include "llvm/ADT/SmallString.h"
20 #include "llvm/Support/Error.h"
22 
23 #include <system_error>
24 
25 using namespace llvm;
26 using namespace llvm::codeview;
27 
28 namespace {
29 /// Use this private dumper implementation to keep implementation details about
30 /// the visitor out of SymbolDumper.h.
31 class CVSymbolDumperImpl : public SymbolVisitorCallbacks {
32 public:
33  CVSymbolDumperImpl(TypeCollection &Types, SymbolDumpDelegate *ObjDelegate,
34  ScopedPrinter &W, CPUType CPU, bool PrintRecordBytes)
35  : Types(Types), ObjDelegate(ObjDelegate), W(W), CompilationCPUType(CPU),
36  PrintRecordBytes(PrintRecordBytes), InFunctionScope(false) {}
37 
38 /// CVSymbolVisitor overrides.
39 #define SYMBOL_RECORD(EnumName, EnumVal, Name) \
40  Error visitKnownRecord(CVSymbol &CVR, Name &Record) override;
41 #define SYMBOL_RECORD_ALIAS(EnumName, EnumVal, Name, AliasName)
42 #include "llvm/DebugInfo/CodeView/CodeViewSymbols.def"
43 
44  Error visitSymbolBegin(CVSymbol &Record) override;
45  Error visitSymbolEnd(CVSymbol &Record) override;
46  Error visitUnknownSymbol(CVSymbol &Record) override;
47 
48  CPUType getCompilationCPUType() const { return CompilationCPUType; }
49 
50 private:
51  void printLocalVariableAddrRange(const LocalVariableAddrRange &Range,
52  uint32_t RelocationOffset);
53  void printLocalVariableAddrGap(ArrayRef<LocalVariableAddrGap> Gaps);
54  void printTypeIndex(StringRef FieldName, TypeIndex TI);
55 
56  TypeCollection &Types;
57  SymbolDumpDelegate *ObjDelegate;
59 
60  /// Save the machine or CPU type when dumping a compile symbols.
61  CPUType CompilationCPUType = CPUType::X64;
62 
63  bool PrintRecordBytes;
64  bool InFunctionScope;
65 };
66 }
67 
69  switch (Kind) {
70 #define SYMBOL_RECORD(EnumName, EnumVal, Name) \
71  case EnumName: \
72  return #Name;
73 #include "llvm/DebugInfo/CodeView/CodeViewSymbols.def"
74  default:
75  break;
76  }
77  return "UnknownSym";
78 }
79 
80 void CVSymbolDumperImpl::printLocalVariableAddrRange(
81  const LocalVariableAddrRange &Range, uint32_t RelocationOffset) {
82  DictScope S(W, "LocalVariableAddrRange");
83  if (ObjDelegate)
84  ObjDelegate->printRelocatedField("OffsetStart", RelocationOffset,
85  Range.OffsetStart);
86  W.printHex("ISectStart", Range.ISectStart);
87  W.printHex("Range", Range.Range);
88 }
89 
90 void CVSymbolDumperImpl::printLocalVariableAddrGap(
92  for (auto &Gap : Gaps) {
93  ListScope S(W, "LocalVariableAddrGap");
94  W.printHex("GapStartOffset", Gap.GapStartOffset);
95  W.printHex("Range", Gap.Range);
96  }
97 }
98 
100  codeview::printTypeIndex(W, FieldName, TI, Types);
101 }
102 
103 Error CVSymbolDumperImpl::visitSymbolBegin(CVSymbol &CVR) {
104  W.startLine() << getSymbolKindName(CVR.kind());
105  W.getOStream() << " {\n";
106  W.indent();
107  W.printEnum("Kind", unsigned(CVR.kind()), getSymbolTypeNames());
108  return Error::success();
109 }
110 
111 Error CVSymbolDumperImpl::visitSymbolEnd(CVSymbol &CVR) {
112  if (PrintRecordBytes && ObjDelegate)
113  ObjDelegate->printBinaryBlockWithRelocs("SymData", CVR.content());
114 
115  W.unindent();
116  W.startLine() << "}\n";
117  return Error::success();
118 }
119 
122  W.printHex("PtrParent", Block.Parent);
123  W.printHex("PtrEnd", Block.End);
124  W.printHex("CodeSize", Block.CodeSize);
125  if (ObjDelegate) {
126  ObjDelegate->printRelocatedField("CodeOffset", Block.getRelocationOffset(),
127  Block.CodeOffset, &LinkageName);
128  }
129  W.printHex("Segment", Block.Segment);
130  W.printString("BlockName", Block.Name);
131  W.printString("LinkageName", LinkageName);
132  return Error::success();
133 }
134 
136  W.printString("Name", Thunk.Name);
137  W.printNumber("Parent", Thunk.Parent);
138  W.printNumber("End", Thunk.End);
139  W.printNumber("Next", Thunk.Next);
140  W.printNumber("Off", Thunk.Offset);
141  W.printNumber("Seg", Thunk.Segment);
142  W.printNumber("Len", Thunk.Length);
143  W.printEnum("Ordinal", uint8_t(Thunk.Thunk), getThunkOrdinalNames());
144  return Error::success();
145 }
146 
148  TrampolineSym &Tramp) {
149  W.printEnum("Type", uint16_t(Tramp.Type), getTrampolineNames());
150  W.printNumber("Size", Tramp.Size);
151  W.printNumber("ThunkOff", Tramp.ThunkOffset);
152  W.printNumber("TargetOff", Tramp.TargetOffset);
153  W.printNumber("ThunkSection", Tramp.ThunkSection);
154  W.printNumber("TargetSection", Tramp.TargetSection);
155  return Error::success();
156 }
157 
159  W.printNumber("SectionNumber", Section.SectionNumber);
160  W.printNumber("Alignment", Section.Alignment);
161  W.printNumber("Rva", Section.Rva);
162  W.printNumber("Length", Section.Length);
163  W.printFlags("Characteristics", Section.Characteristics,
165  COFF::SectionCharacteristics(0x00F00000));
166 
167  W.printString("Name", Section.Name);
168  return Error::success();
169 }
170 
172  CoffGroupSym &CoffGroup) {
173  W.printNumber("Size", CoffGroup.Size);
174  W.printFlags("Characteristics", CoffGroup.Characteristics,
176  COFF::SectionCharacteristics(0x00F00000));
177  W.printNumber("Offset", CoffGroup.Offset);
178  W.printNumber("Segment", CoffGroup.Segment);
179  W.printString("Name", CoffGroup.Name);
180  return Error::success();
181 }
182 
184  BPRelativeSym &BPRel) {
185  W.printNumber("Offset", BPRel.Offset);
186  printTypeIndex("Type", BPRel.Type);
187  W.printString("VarName", BPRel.Name);
188  return Error::success();
189 }
190 
192  BuildInfoSym &BuildInfo) {
193  printTypeIndex("BuildId", BuildInfo.BuildId);
194  return Error::success();
195 }
196 
198  CallSiteInfoSym &CallSiteInfo) {
200  if (ObjDelegate) {
201  ObjDelegate->printRelocatedField("CodeOffset",
202  CallSiteInfo.getRelocationOffset(),
203  CallSiteInfo.CodeOffset, &LinkageName);
204  }
205  W.printHex("Segment", CallSiteInfo.Segment);
206  printTypeIndex("Type", CallSiteInfo.Type);
207  if (!LinkageName.empty())
208  W.printString("LinkageName", LinkageName);
209  return Error::success();
210 }
211 
213  EnvBlockSym &EnvBlock) {
214  ListScope L(W, "Entries");
215  for (auto Entry : EnvBlock.Fields) {
216  W.printString(Entry);
217  }
218  return Error::success();
219 }
220 
222  FileStaticSym &FileStatic) {
223  printTypeIndex("Index", FileStatic.Index);
224  W.printNumber("ModFilenameOffset", FileStatic.ModFilenameOffset);
225  W.printFlags("Flags", uint16_t(FileStatic.Flags), getLocalFlagNames());
226  W.printString("Name", FileStatic.Name);
227  return Error::success();
228 }
229 
231  W.printNumber("Ordinal", Export.Ordinal);
232  W.printFlags("Flags", uint16_t(Export.Flags), getExportSymFlagNames());
233  W.printString("Name", Export.Name);
234  return Error::success();
235 }
236 
238  Compile2Sym &Compile2) {
239  W.printEnum("Language", Compile2.getLanguage(), getSourceLanguageNames());
240  W.printFlags("Flags", Compile2.getFlags(), getCompileSym2FlagNames());
241  W.printEnum("Machine", unsigned(Compile2.Machine), getCPUTypeNames());
242  CompilationCPUType = Compile2.Machine;
243  std::string FrontendVersion;
244  {
245  raw_string_ostream Out(FrontendVersion);
246  Out << Compile2.VersionFrontendMajor << '.' << Compile2.VersionFrontendMinor
247  << '.' << Compile2.VersionFrontendBuild;
248  }
249  std::string BackendVersion;
250  {
251  raw_string_ostream Out(BackendVersion);
252  Out << Compile2.VersionBackendMajor << '.' << Compile2.VersionBackendMinor
253  << '.' << Compile2.VersionBackendBuild;
254  }
255  W.printString("FrontendVersion", FrontendVersion);
256  W.printString("BackendVersion", BackendVersion);
257  W.printString("VersionName", Compile2.Version);
258  return Error::success();
259 }
260 
262  Compile3Sym &Compile3) {
263  W.printEnum("Language", uint8_t(Compile3.getLanguage()), getSourceLanguageNames());
264  W.printFlags("Flags", uint32_t(Compile3.getFlags()),
266  W.printEnum("Machine", unsigned(Compile3.Machine), getCPUTypeNames());
267  CompilationCPUType = Compile3.Machine;
268  std::string FrontendVersion;
269  {
270  raw_string_ostream Out(FrontendVersion);
271  Out << Compile3.VersionFrontendMajor << '.' << Compile3.VersionFrontendMinor
272  << '.' << Compile3.VersionFrontendBuild << '.'
273  << Compile3.VersionFrontendQFE;
274  }
275  std::string BackendVersion;
276  {
277  raw_string_ostream Out(BackendVersion);
278  Out << Compile3.VersionBackendMajor << '.' << Compile3.VersionBackendMinor
279  << '.' << Compile3.VersionBackendBuild << '.'
280  << Compile3.VersionBackendQFE;
281  }
282  W.printString("FrontendVersion", FrontendVersion);
283  W.printString("BackendVersion", BackendVersion);
284  W.printString("VersionName", Compile3.Version);
285  return Error::success();
286 }
287 
290  printTypeIndex("Type", Constant.Type);
291  W.printNumber("Value", Constant.Value);
292  W.printString("Name", Constant.Name);
293  return Error::success();
294 }
295 
298  if (ObjDelegate) {
299  ObjDelegate->printRelocatedField("DataOffset", Data.getRelocationOffset(),
300  Data.DataOffset, &LinkageName);
301  }
302  printTypeIndex("Type", Data.Type);
303  W.printString("DisplayName", Data.Name);
304  if (!LinkageName.empty())
305  W.printString("LinkageName", LinkageName);
306  return Error::success();
307 }
308 
310  CVSymbol &CVR,
311  DefRangeFramePointerRelFullScopeSym &DefRangeFramePointerRelFullScope) {
312  W.printNumber("Offset", DefRangeFramePointerRelFullScope.Offset);
313  return Error::success();
314 }
315 
317  CVSymbol &CVR, DefRangeFramePointerRelSym &DefRangeFramePointerRel) {
318  W.printNumber("Offset", DefRangeFramePointerRel.Offset);
319  printLocalVariableAddrRange(DefRangeFramePointerRel.Range,
320  DefRangeFramePointerRel.getRelocationOffset());
321  printLocalVariableAddrGap(DefRangeFramePointerRel.Gaps);
322  return Error::success();
323 }
324 
326  CVSymbol &CVR, DefRangeRegisterRelSym &DefRangeRegisterRel) {
327  W.printEnum("BaseRegister", uint16_t(DefRangeRegisterRel.Hdr.Register),
328  getRegisterNames());
329  W.printBoolean("HasSpilledUDTMember",
330  DefRangeRegisterRel.hasSpilledUDTMember());
331  W.printNumber("OffsetInParent", DefRangeRegisterRel.offsetInParent());
332  W.printNumber("BasePointerOffset", DefRangeRegisterRel.Hdr.BasePointerOffset);
333  printLocalVariableAddrRange(DefRangeRegisterRel.Range,
334  DefRangeRegisterRel.getRelocationOffset());
335  printLocalVariableAddrGap(DefRangeRegisterRel.Gaps);
336  return Error::success();
337 }
338 
340  CVSymbol &CVR, DefRangeRegisterSym &DefRangeRegister) {
341  W.printEnum("Register", uint16_t(DefRangeRegister.Hdr.Register),
342  getRegisterNames());
343  W.printNumber("MayHaveNoName", DefRangeRegister.Hdr.MayHaveNoName);
344  printLocalVariableAddrRange(DefRangeRegister.Range,
345  DefRangeRegister.getRelocationOffset());
346  printLocalVariableAddrGap(DefRangeRegister.Gaps);
347  return Error::success();
348 }
349 
351  CVSymbol &CVR, DefRangeSubfieldRegisterSym &DefRangeSubfieldRegister) {
352  W.printEnum("Register", uint16_t(DefRangeSubfieldRegister.Hdr.Register),
353  getRegisterNames());
354  W.printNumber("MayHaveNoName", DefRangeSubfieldRegister.Hdr.MayHaveNoName);
355  W.printNumber("OffsetInParent", DefRangeSubfieldRegister.Hdr.OffsetInParent);
356  printLocalVariableAddrRange(DefRangeSubfieldRegister.Range,
357  DefRangeSubfieldRegister.getRelocationOffset());
358  printLocalVariableAddrGap(DefRangeSubfieldRegister.Gaps);
359  return Error::success();
360 }
361 
363  CVSymbol &CVR, DefRangeSubfieldSym &DefRangeSubfield) {
364  if (ObjDelegate) {
365  DebugStringTableSubsectionRef Strings = ObjDelegate->getStringTable();
366  auto ExpectedProgram = Strings.getString(DefRangeSubfield.Program);
367  if (!ExpectedProgram) {
368  consumeError(ExpectedProgram.takeError());
369  return llvm::make_error<CodeViewError>(
370  "String table offset outside of bounds of String Table!");
371  }
372  W.printString("Program", *ExpectedProgram);
373  }
374  W.printNumber("OffsetInParent", DefRangeSubfield.OffsetInParent);
375  printLocalVariableAddrRange(DefRangeSubfield.Range,
376  DefRangeSubfield.getRelocationOffset());
377  printLocalVariableAddrGap(DefRangeSubfield.Gaps);
378  return Error::success();
379 }
380 
382  DefRangeSym &DefRange) {
383  if (ObjDelegate) {
384  DebugStringTableSubsectionRef Strings = ObjDelegate->getStringTable();
385  auto ExpectedProgram = Strings.getString(DefRange.Program);
386  if (!ExpectedProgram) {
387  consumeError(ExpectedProgram.takeError());
388  return llvm::make_error<CodeViewError>(
389  "String table offset outside of bounds of String Table!");
390  }
391  W.printString("Program", *ExpectedProgram);
392  }
393  printLocalVariableAddrRange(DefRange.Range, DefRange.getRelocationOffset());
394  printLocalVariableAddrGap(DefRange.Gaps);
395  return Error::success();
396 }
397 
399  FrameCookieSym &FrameCookie) {
401  if (ObjDelegate) {
402  ObjDelegate->printRelocatedField("CodeOffset",
403  FrameCookie.getRelocationOffset(),
404  FrameCookie.CodeOffset, &LinkageName);
405  }
406  W.printEnum("Register", uint16_t(FrameCookie.Register), getRegisterNames());
407  W.printEnum("CookieKind", uint16_t(FrameCookie.CookieKind),
409  W.printHex("Flags", FrameCookie.Flags);
410  return Error::success();
411 }
412 
414  FrameProcSym &FrameProc) {
415  W.printHex("TotalFrameBytes", FrameProc.TotalFrameBytes);
416  W.printHex("PaddingFrameBytes", FrameProc.PaddingFrameBytes);
417  W.printHex("OffsetToPadding", FrameProc.OffsetToPadding);
418  W.printHex("BytesOfCalleeSavedRegisters",
419  FrameProc.BytesOfCalleeSavedRegisters);
420  W.printHex("OffsetOfExceptionHandler", FrameProc.OffsetOfExceptionHandler);
421  W.printHex("SectionIdOfExceptionHandler",
422  FrameProc.SectionIdOfExceptionHandler);
423  W.printFlags("Flags", static_cast<uint32_t>(FrameProc.Flags),
425  W.printEnum("LocalFramePtrReg",
426  uint16_t(FrameProc.getLocalFramePtrReg(CompilationCPUType)),
427  getRegisterNames());
428  W.printEnum("ParamFramePtrReg",
429  uint16_t(FrameProc.getParamFramePtrReg(CompilationCPUType)),
430  getRegisterNames());
431  return Error::success();
432 }
433 
435  CVSymbol &CVR, HeapAllocationSiteSym &HeapAllocSite) {
437  if (ObjDelegate) {
438  ObjDelegate->printRelocatedField("CodeOffset",
439  HeapAllocSite.getRelocationOffset(),
440  HeapAllocSite.CodeOffset, &LinkageName);
441  }
442  W.printHex("Segment", HeapAllocSite.Segment);
443  W.printHex("CallInstructionSize", HeapAllocSite.CallInstructionSize);
444  printTypeIndex("Type", HeapAllocSite.Type);
445  if (!LinkageName.empty())
446  W.printString("LinkageName", LinkageName);
447  return Error::success();
448 }
449 
451  InlineSiteSym &InlineSite) {
452  W.printHex("PtrParent", InlineSite.Parent);
453  W.printHex("PtrEnd", InlineSite.End);
454  printTypeIndex("Inlinee", InlineSite.Inlinee);
455 
456  ListScope BinaryAnnotations(W, "BinaryAnnotations");
457  for (auto &Annotation : InlineSite.annotations()) {
458  switch (Annotation.OpCode) {
460  W.printString("(Annotation Padding)");
461  break;
465  W.printHex(Annotation.Name, Annotation.U1);
466  break;
472  W.printNumber(Annotation.Name, Annotation.U1);
473  break;
476  W.printNumber(Annotation.Name, Annotation.S1);
477  break;
479  if (ObjDelegate) {
480  W.printHex("ChangeFile",
481  ObjDelegate->getFileNameForFileOffset(Annotation.U1),
482  Annotation.U1);
483  } else {
484  W.printHex("ChangeFile", Annotation.U1);
485  }
486 
487  break;
489  W.startLine() << "ChangeCodeOffsetAndLineOffset: {CodeOffset: "
490  << W.hex(Annotation.U1) << ", LineOffset: " << Annotation.S1
491  << "}\n";
492  break;
493  }
495  W.startLine() << "ChangeCodeLengthAndCodeOffset: {CodeOffset: "
496  << W.hex(Annotation.U2)
497  << ", Length: " << W.hex(Annotation.U1) << "}\n";
498  break;
499  }
500  }
501  }
502  return Error::success();
503 }
504 
507  printTypeIndex("Type", Register.Index);
508  W.printEnum("Seg", uint16_t(Register.Register), getRegisterNames());
509  W.printString("Name", Register.Name);
510  return Error::success();
511 }
512 
514  W.printFlags("Flags", uint32_t(Public.Flags), getPublicSymFlagNames());
515  W.printNumber("Seg", Public.Segment);
516  W.printNumber("Off", Public.Offset);
517  W.printString("Name", Public.Name);
518  return Error::success();
519 }
520 
522  W.printNumber("SumName", ProcRef.SumName);
523  W.printNumber("SymOffset", ProcRef.SymOffset);
524  W.printNumber("Mod", ProcRef.Module);
525  W.printString("Name", ProcRef.Name);
526  return Error::success();
527 }
528 
531  if (ObjDelegate) {
532  ObjDelegate->printRelocatedField("CodeOffset", Label.getRelocationOffset(),
533  Label.CodeOffset, &LinkageName);
534  }
535  W.printHex("Segment", Label.Segment);
536  W.printHex("Flags", uint8_t(Label.Flags));
537  W.printFlags("Flags", uint8_t(Label.Flags), getProcSymFlagNames());
538  W.printString("DisplayName", Label.Name);
539  if (!LinkageName.empty())
540  W.printString("LinkageName", LinkageName);
541  return Error::success();
542 }
543 
545  printTypeIndex("Type", Local.Type);
546  W.printFlags("Flags", uint16_t(Local.Flags), getLocalFlagNames());
547  W.printString("VarName", Local.Name);
548  return Error::success();
549 }
550 
552  W.printHex("Signature", ObjName.Signature);
553  W.printString("ObjectName", ObjName.Name);
554  return Error::success();
555 }
556 
558  if (InFunctionScope)
559  return llvm::make_error<CodeViewError>(
560  "Visiting a ProcSym while inside function scope!");
561 
562  InFunctionScope = true;
563 
565  W.printHex("PtrParent", Proc.Parent);
566  W.printHex("PtrEnd", Proc.End);
567  W.printHex("PtrNext", Proc.Next);
568  W.printHex("CodeSize", Proc.CodeSize);
569  W.printHex("DbgStart", Proc.DbgStart);
570  W.printHex("DbgEnd", Proc.DbgEnd);
571  printTypeIndex("FunctionType", Proc.FunctionType);
572  if (ObjDelegate) {
573  ObjDelegate->printRelocatedField("CodeOffset", Proc.getRelocationOffset(),
574  Proc.CodeOffset, &LinkageName);
575  }
576  W.printHex("Segment", Proc.Segment);
577  W.printFlags("Flags", static_cast<uint8_t>(Proc.Flags),
579  W.printString("DisplayName", Proc.Name);
580  if (!LinkageName.empty())
581  W.printString("LinkageName", LinkageName);
582  return Error::success();
583 }
584 
586  ScopeEndSym &ScopeEnd) {
587  InFunctionScope = false;
588  return Error::success();
589 }
590 
592  ListScope S(W, CVR.kind() == S_CALLEES ? "Callees" : "Callers");
593  for (auto FuncID : Caller.Indices)
594  printTypeIndex("FuncID", FuncID);
595  return Error::success();
596 }
597 
599  RegRelativeSym &RegRel) {
600  W.printHex("Offset", RegRel.Offset);
601  printTypeIndex("Type", RegRel.Type);
602  W.printEnum("Register", uint16_t(RegRel.Register), getRegisterNames());
603  W.printString("VarName", RegRel.Name);
604  return Error::success();
605 }
606 
608  ThreadLocalDataSym &Data) {
610  if (ObjDelegate) {
611  ObjDelegate->printRelocatedField("DataOffset", Data.getRelocationOffset(),
612  Data.DataOffset, &LinkageName);
613  }
614  printTypeIndex("Type", Data.Type);
615  W.printString("DisplayName", Data.Name);
616  if (!LinkageName.empty())
617  W.printString("LinkageName", LinkageName);
618  return Error::success();
619 }
620 
622  printTypeIndex("Type", UDT.Type);
623  W.printString("UDTName", UDT.Name);
624  return Error::success();
625 }
626 
628  UsingNamespaceSym &UN) {
629  W.printString("Namespace", UN.Name);
630  return Error::success();
631 }
632 
633 Error CVSymbolDumperImpl::visitUnknownSymbol(CVSymbol &CVR) {
634  W.printNumber("Length", CVR.length());
635  return Error::success();
636 }
637 
640  SymbolDeserializer Deserializer(ObjDelegate.get(), Container);
641  CVSymbolDumperImpl Dumper(Types, ObjDelegate.get(), W, CompilationCPUType,
642  PrintRecordBytes);
643 
644  Pipeline.addCallbackToPipeline(Deserializer);
645  Pipeline.addCallbackToPipeline(Dumper);
646  CVSymbolVisitor Visitor(Pipeline);
647  auto Err = Visitor.visitSymbolRecord(Record);
648  CompilationCPUType = Dumper.getCompilationCPUType();
649  return Err;
650 }
651 
654  SymbolDeserializer Deserializer(ObjDelegate.get(), Container);
655  CVSymbolDumperImpl Dumper(Types, ObjDelegate.get(), W, CompilationCPUType,
656  PrintRecordBytes);
657 
658  Pipeline.addCallbackToPipeline(Deserializer);
659  Pipeline.addCallbackToPipeline(Dumper);
660  CVSymbolVisitor Visitor(Pipeline);
661  auto Err = Visitor.visitSymbolStream(Symbols);
662  CompilationCPUType = Dumper.getCompilationCPUType();
663  return Err;
664 }
uint32_t getRelocationOffset() const
Definition: SymbolRecord.h:802
Kind kind() const
Definition: CVRecord.h:43
This class represents lattice values for constants.
Definition: AllocatorList.h:23
uint32_t getRelocationOffset() const
Definition: SymbolRecord.h:844
ArrayRef< EnumEntry< uint16_t > > getExportSymFlagNames()
Definition: EnumTables.cpp:347
ArrayRef< EnumEntry< uint32_t > > getCompileSym3FlagNames()
Definition: EnumTables.cpp:331
CompileSym3Flags getFlags() const
Definition: SymbolRecord.h:748
FrameProcedureOptions Flags
Definition: SymbolRecord.h:774
ArrayRef< EnumEntry< uint16_t > > getRegisterNames()
Definition: EnumTables.cpp:303
Error visitSymbolRecord(CVSymbol &Record)
Expected< StringRef > getString(uint32_t Offset) const
ArrayRef< EnumEntry< uint32_t > > getPublicSymFlagNames()
Definition: EnumTables.cpp:307
std::vector< LocalVariableAddrGap > Gaps
Definition: SymbolRecord.h:517
std::vector< LocalVariableAddrGap > Gaps
Definition: SymbolRecord.h:574
RegisterId getParamFramePtrReg(CPUType CPU) const
Extract the register this frame uses to refer to parameters.
Definition: SymbolRecord.h:783
ArrayRef< EnumEntry< uint8_t > > getThunkOrdinalNames()
Definition: EnumTables.cpp:355
ArrayRef< uint8_t > content() const
Definition: CVRecord.h:57
LLVM_NODISCARD bool empty() const
empty - Check if the string is empty.
Definition: StringRef.h:126
uint8_t getLanguage() const
Definition: SymbolRecord.h:714
ArrayRef< EnumEntry< uint8_t > > getFrameCookieKindNames()
Definition: EnumTables.cpp:319
static Error visitKnownRecord(CVSymbol &Record, SymbolVisitorCallbacks &Callbacks)
A 32-bit type reference.
Definition: TypeIndex.h:95
ArrayRef - Represent a constant reference to an array (0 or more elements consecutively in memory)...
Definition: APInt.h:32
uint32_t length() const
Definition: CVRecord.h:41
ArrayRef< EnumEntry< COFF::SectionCharacteristics > > getImageSectionCharacteristicNames()
Definition: EnumTables.cpp:364
SectionCharacteristics
Definition: COFF.h:283
uint32_t getRelocationOffset() const
Definition: SymbolRecord.h:443
static StringRef getSymbolKindName(SymbolKind Kind)
ArrayRef< EnumEntry< unsigned > > getCPUTypeNames()
Definition: EnumTables.cpp:339
void printTypeIndex(ScopedPrinter &Printer, StringRef FieldName, TypeIndex TI, TypeCollection &Types)
Definition: TypeIndex.cpp:92
std::vector< LocalVariableAddrGap > Gaps
Definition: SymbolRecord.h:493
void addCallbackToPipeline(SymbolVisitorCallbacks &Callbacks)
This is an important base class in LLVM.
Definition: Constant.h:41
std::vector< StringRef > Fields
Definition: SymbolRecord.h:660
LocalVariableAddrRange Range
Definition: SymbolRecord.h:448
uint32_t getFlags() const
Definition: SymbolRecord.h:715
std::vector< TypeIndex > Indices
Definition: SymbolRecord.h:153
LocalVariableAddrRange Range
Definition: SymbolRecord.h:492
std::vector< LocalVariableAddrGap > Gaps
Definition: SymbolRecord.h:449
void consumeError(Error Err)
Consume a Error without doing anything.
Definition: Error.h:981
LocalVariableAddrRange Range
Definition: SymbolRecord.h:470
Error dump(CVRecord< SymbolKind > &Record)
Dumps one type record.
ArrayRef< EnumEntry< uint32_t > > getFrameProcSymFlagNames()
Definition: EnumTables.cpp:343
static ErrorSuccess success()
Create a success value.
Definition: Error.h:326
uint32_t getRelocationOffset() const
Definition: SymbolRecord.h:937
ArrayRef< EnumEntry< SymbolKind > > getSymbolTypeNames()
Definition: EnumTables.cpp:295
CPUType
These values correspond to the CV_CPU_TYPE_e enumeration, and are documented here: https://msdn...
Definition: CodeView.h:78
Promote Memory to Register
Definition: Mem2Reg.cpp:109
ArrayRef< EnumEntry< uint8_t > > getProcSymFlagNames()
Definition: EnumTables.cpp:311
ArrayRef< EnumEntry< SourceLanguage > > getSourceLanguageNames()
Definition: EnumTables.cpp:323
ArrayRef< EnumEntry< uint32_t > > getCompileSym2FlagNames()
Definition: EnumTables.cpp:327
Represents a read-only view of a CodeView string table.
ArrayRef< EnumEntry< uint16_t > > getTrampolineNames()
Definition: EnumTables.cpp:359
Error visitSymbolStream(const CVSymbolArray &Symbols)
std::vector< LocalVariableAddrGap > Gaps
Definition: SymbolRecord.h:539
SourceLanguage getLanguage() const
Definition: SymbolRecord.h:745
uint32_t getRelocationOffset() const
Definition: SymbolRecord.h:49
RegisterId getLocalFramePtrReg(CPUType CPU) const
Extract the register this frame uses to refer to local variables.
Definition: SymbolRecord.h:777
SymbolKind
Duplicate copy of the above enum, but using the official CV names.
Definition: CodeView.h:47
uint32_t getRelocationOffset() const
Definition: SymbolRecord.h:625
iterator_range< BinaryAnnotationIterator > annotations() const
Definition: SymbolRecord.h:344
std::vector< LocalVariableAddrGap > Gaps
Definition: SymbolRecord.h:471
A raw_ostream that writes to an std::string.
Definition: raw_ostream.h:482
Lightweight error class with error context and mandatory checking.
Definition: Error.h:157
ArrayRef< EnumEntry< uint16_t > > getLocalFlagNames()
Definition: EnumTables.cpp:315
uint32_t getRelocationOffset() const
Definition: SymbolRecord.h:602
StringRef - Represent a constant reference to a string, i.e.
Definition: StringRef.h:48
CVRecord is a fat pointer (base + size pair) to a symbol or type record.
Definition: CVRecord.h:30