llvm.org GIT mirror llvm / d36e155
[llvm-pdbutil] Output the symbol offset when dumping. Type records have a unique type index, but symbol records do not. Instead, symbol records refer to other symbol records by referencing their offset in the symbol stream. In a sense this is the analogue of the TypeIndex, but we are not printing it in the dumper. Printing it not only gives us more useful information when manually investigating the contents of a PDB, but also allows us to write better tests by enabling us to verify that fields that reference other symbol records do so correctly. Differential Revision: https://reviews.llvm.org/D34906 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@306890 91177308-0d34-0410-b5e6-96231b3b80d8 Zachary Turner 2 years ago
9 changed file(s) with 183 addition(s) and 102 deletion(s). Raw diff Collapse all Expand all
2424 CVSymbolVisitor(SymbolVisitorCallbacks &Callbacks);
2525
2626 Error visitSymbolRecord(CVSymbol &Record);
27 Error visitSymbolRecord(CVSymbol &Record, uint32_t Offset);
2728 Error visitSymbolStream(const CVSymbolArray &Symbols);
29 Error visitSymbolStream(const CVSymbolArray &Symbols, uint32_t InitialOffset);
2830
2931 private:
3032 SymbolVisitorCallbacks &Callbacks;
5050 CodeViewContainer Container)
5151 : Delegate(Delegate), Container(Container) {}
5252
53 Error visitSymbolBegin(CVSymbol &Record, uint32_t Offset) override {
54 return visitSymbolBegin(Record);
55 }
56
5357 Error visitSymbolBegin(CVSymbol &Record) override {
5458 assert(!Mapping && "Already in a symbol mapping!");
5559 Mapping = llvm::make_unique(Record.content(), Container);
2424 Error visitUnknownSymbol(CVSymbol &Record) override {
2525 for (auto Visitor : Pipeline) {
2626 if (auto EC = Visitor->visitUnknownSymbol(Record))
27 return EC;
28 }
29 return Error::success();
30 }
31
32 Error visitSymbolBegin(CVSymbol &Record, uint32_t Offset) override {
33 for (auto Visitor : Pipeline) {
34 if (auto EC = Visitor->visitSymbolBegin(Record, Offset))
2735 return EC;
2836 }
2937 return Error::success();
2828
2929 /// Paired begin/end actions for all symbols. Receives all record data,
3030 /// including the fixed-length record prefix. visitSymbolBegin() should
31 /// return
32 /// the type of the Symbol, or an error if it cannot be determined.
31 /// return the type of the Symbol, or an error if it cannot be determined.
32 virtual Error visitSymbolBegin(CVSymbol &Record, uint32_t Offset) {
33 return Error::success();
34 }
3335 virtual Error visitSymbolBegin(CVSymbol &Record) { return Error::success(); }
3436 virtual Error visitSymbolEnd(CVSymbol &Record) { return Error::success(); }
3537
2828 return Error::success();
2929 }
3030
31 Error CVSymbolVisitor::visitSymbolRecord(CVSymbol &Record) {
32 if (auto EC = Callbacks.visitSymbolBegin(Record))
33 return EC;
34
31 static Error finishVisitation(CVSymbol &Record,
32 SymbolVisitorCallbacks &Callbacks) {
3533 switch (Record.Type) {
3634 default:
3735 if (auto EC = Callbacks.visitUnknownSymbol(Record))
5452 return Error::success();
5553 }
5654
55 Error CVSymbolVisitor::visitSymbolRecord(CVSymbol &Record) {
56 if (auto EC = Callbacks.visitSymbolBegin(Record))
57 return EC;
58 return finishVisitation(Record, Callbacks);
59 }
60
61 Error CVSymbolVisitor::visitSymbolRecord(CVSymbol &Record, uint32_t Offset) {
62 if (auto EC = Callbacks.visitSymbolBegin(Record, Offset))
63 return EC;
64 return finishVisitation(Record, Callbacks);
65 }
66
5767 Error CVSymbolVisitor::visitSymbolStream(const CVSymbolArray &Symbols) {
5868 for (auto I : Symbols) {
5969 if (auto EC = visitSymbolRecord(I))
6171 }
6272 return Error::success();
6373 }
74
75 Error CVSymbolVisitor::visitSymbolStream(const CVSymbolArray &Symbols,
76 uint32_t InitialOffset) {
77 for (auto I : Symbols) {
78 if (auto EC = visitSymbolRecord(I, InitialOffset))
79 return EC;
80 InitialOffset += I.length();
81 }
82 return Error::success();
83 }
473473 ALL: Hash Adjusters:
474474 ALL: Public Symbols
475475 ALL-NEXT: ============================================================
476 ALL-NEXT: - S_PUB32 [size = 36] `?__purecall@@3PAXA`
476 ALL-NEXT: 0 | S_PUB32 [size = 36] `?__purecall@@3PAXA`
477477 ALL-NEXT: flags = none, addr = 0003:0000
478 ALL-NEXT: - S_PUB32 [size = 20] `_main`
478 ALL-NEXT: 36 | S_PUB32 [size = 20] `_main`
479479 ALL-NEXT: flags = function, addr = 0001:0016
480 ALL-NEXT: - S_PROCREF [size = 20] `main`
480 ALL-NEXT: 56 | S_PROCREF [size = 20] `main`
481481 ALL-NEXT: module = 1, sum name = 0, offset = 120
482 ALL-NEXT: - S_GDATA32 [size = 28] `__purecall`
482 ALL-NEXT: 76 | S_GDATA32 [size = 28] `__purecall`
483483 ALL-NEXT: type = 0x0403 (void*), addr = 0003:0000
484484 ALL: Symbols
485485 ALL-NEXT: ============================================================
486486 ALL-NEXT: Mod 0000 | `d:\src\llvm\test\DebugInfo\PDB\Inputs\empty.obj`:
487 ALL-NEXT: - S_OBJNAME [size = 56] sig=0, `d:\src\llvm\test\DebugInfo\PDB\Inputs\empty.obj`
488 ALL-NEXT: - S_COMPILE3 [size = 60]
489 ALL-NEXT: machine = intel pentium 3, Ver = Microsoft (R) Optimizing Compiler, language = c++
490 ALL-NEXT: frontend = 18.0.31101.0, backend = 18.0.31101.0
491 ALL-NEXT: flags = security checks
492 ALL-NEXT: - S_GPROC32 [size = 44] `main`
493 ALL-NEXT: parent = 0, addr = 0001:0016, code size = 10, end = 196
494 ALL-NEXT: debug start = 3, debug end = 8, flags = has fp
495 ALL-NEXT: - S_FRAMEPROC [size = 32]
496 ALL-NEXT: size = 0, padding size = 0, offset to padding = 0
497 ALL-NEXT: bytes of callee saved registers = 0, exception handler addr = 0000:0000
498 ALL-NEXT: flags = has async eh | opt speed
499 ALL-NEXT: - S_END [size = 4]
500 ALL-NEXT: - S_BUILDINFO [size = 8] BuildId = `4110`
487 ALL-NEXT: 4 | S_OBJNAME [size = 56] sig=0, `d:\src\llvm\test\DebugInfo\PDB\Inputs\empty.obj`
488 ALL-NEXT: 60 | S_COMPILE3 [size = 60]
489 ALL-NEXT: machine = intel pentium 3, Ver = Microsoft (R) Optimizing Compiler, language = c++
490 ALL-NEXT: frontend = 18.0.31101.0, backend = 18.0.31101.0
491 ALL-NEXT: flags = security checks
492 ALL-NEXT: 120 | S_GPROC32 [size = 44] `main`
493 ALL-NEXT: parent = 0, end = 196, addr = 0001:0016, code size = 10
494 ALL-NEXT: debug start = 3, debug end = 8, flags = has fp
495 ALL-NEXT: 164 | S_FRAMEPROC [size = 32]
496 ALL-NEXT: size = 0, padding size = 0, offset to padding = 0
497 ALL-NEXT: bytes of callee saved registers = 0, exception handler addr = 0000:0000
498 ALL-NEXT: flags = has async eh | opt speed
499 ALL-NEXT: 196 | S_END [size = 4]
500 ALL-NEXT: 200 | S_BUILDINFO [size = 8] BuildId = `4110`
501501 ALL-NEXT: Mod 0001 | `* Linker *`:
502 ALL-NEXT: - S_OBJNAME [size = 20] sig=0, `* Linker *`
503 ALL-NEXT: - S_COMPILE3 [size = 48]
504 ALL-NEXT: machine = intel 80386, Ver = Microsoft (R) LINK, language = link
505 ALL-NEXT: frontend = 0.0.0.0, backend = 12.0.31101.0
506 ALL-NEXT: flags = none
507 ALL-NEXT: - S_ENVBLOCK [size = 172]
508 ALL-NEXT: - cwd
509 ALL-NEXT: - d:\src\llvm\test\DebugInfo\PDB\Inputs
510 ALL-NEXT: - exe
511 ALL-NEXT: - C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\BIN\link.exe
512 ALL-NEXT: - pdb
513 ALL-NEXT: - d:\src\llvm\test\DebugInfo\PDB\Inputs\empty.pdb
514 ALL-NEXT: - S_TRAMPOLINE [size = 20]
515 ALL-NEXT: type = tramp incremental, size = 5, source = 0001:0005, target = 0001:0005
516 ALL-NEXT: - S_SECTION [size = 28] `.text`
517 ALL-NEXT: length = 4122, alignment = 12, rva = 4096, section # = 1, characteristics = 1610612768
518 ALL-NEXT: - S_COFFGROUP [size = 28] `.text$mn`
519 ALL-NEXT: length = 4122, addr = 0001:0000, characteristics = 1610612768
520 ALL-NEXT: - S_SECTION [size = 28] `.rdata`
521 ALL-NEXT: length = 690, alignment = 12, rva = 12288, section # = 2, characteristics = 1073741888
522 ALL-NEXT: - S_COFFGROUP [size = 28] `.rdata`
523 ALL-NEXT: length = 323, addr = 0002:0000, characteristics = 1073741888
524 ALL-NEXT: - S_COFFGROUP [size = 28] `.edata`
525 ALL-NEXT: length = 0, addr = 0002:0323, characteristics = 1073741888
526 ALL-NEXT: - S_COFFGROUP [size = 32] `.rdata$debug`
527 ALL-NEXT: length = 366, addr = 0002:0324, characteristics = 1073741888
528 ALL-NEXT: - S_SECTION [size = 28] `.data`
529 ALL-NEXT: length = 4, alignment = 12, rva = 16384, section # = 3, characteristics = 3221225536
530 ALL-NEXT: - S_COFFGROUP [size = 24] `.bss`
531 ALL-NEXT: length = 4, addr = 0003:0000, characteristics = 3221225600
532 ALL-NEXT: - S_SECTION [size = 28] `.reloc`
533 ALL-NEXT: length = 8, alignment = 12, rva = 20480, section # = 4, characteristics = 1107296320
502 ALL-NEXT: 4 | S_OBJNAME [size = 20] sig=0, `* Linker *`
503 ALL-NEXT: 24 | S_COMPILE3 [size = 48]
504 ALL-NEXT: machine = intel 80386, Ver = Microsoft (R) LINK, language = link
505 ALL-NEXT: frontend = 0.0.0.0, backend = 12.0.31101.0
506 ALL-NEXT: flags = none
507 ALL-NEXT: 72 | S_ENVBLOCK [size = 172]
508 ALL-NEXT: - cwd
509 ALL-NEXT: - d:\src\llvm\test\DebugInfo\PDB\Inputs
510 ALL-NEXT: - exe
511 ALL-NEXT: - C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\BIN\link.exe
512 ALL-NEXT: - pdb
513 ALL-NEXT: - d:\src\llvm\test\DebugInfo\PDB\Inputs\empty.pdb
514 ALL-NEXT: 244 | S_TRAMPOLINE [size = 20]
515 ALL-NEXT: type = tramp incremental, size = 5, source = 0001:0005, target = 0001:0005
516 ALL-NEXT: 264 | S_SECTION [size = 28] `.text`
517 ALL-NEXT: length = 4122, alignment = 12, rva = 4096, section # = 1, characteristics = 1610612768
518 ALL-NEXT: 292 | S_COFFGROUP [size = 28] `.text$mn`
519 ALL-NEXT: length = 4122, addr = 0001:0000, characteristics = 1610612768
520 ALL-NEXT: 320 | S_SECTION [size = 28] `.rdata`
521 ALL-NEXT: length = 690, alignment = 12, rva = 12288, section # = 2, characteristics = 1073741888
522 ALL-NEXT: 348 | S_COFFGROUP [size = 28] `.rdata`
523 ALL-NEXT: length = 323, addr = 0002:0000, characteristics = 1073741888
524 ALL-NEXT: 376 | S_COFFGROUP [size = 28] `.edata`
525 ALL-NEXT: length = 0, addr = 0002:0323, characteristics = 1073741888
526 ALL-NEXT: 404 | S_COFFGROUP [size = 32] `.rdata$debug`
527 ALL-NEXT: length = 366, addr = 0002:0324, characteristics = 1073741888
528 ALL-NEXT: 436 | S_SECTION [size = 28] `.data`
529 ALL-NEXT: length = 4, alignment = 12, rva = 16384, section # = 3, characteristics = 3221225536
530 ALL-NEXT: 464 | S_COFFGROUP [size = 24] `.bss`
531 ALL-NEXT: length = 4, addr = 0003:0000, characteristics = 3221225600
532 ALL-NEXT: 488 | S_SECTION [size = 28] `.reloc`
533 ALL-NEXT: length = 8, alignment = 12, rva = 20480, section # = 4, characteristics = 1107296320
534534 ALL: Section Contributions
535535 ALL-NEXT: ============================================================
536536 ALL-NEXT: SC | mod = 1, 0001:0000, size = 10, data crc = 0, reloc crc = 0
833833 Pipeline.addCallbackToPipeline(Deserializer);
834834 Pipeline.addCallbackToPipeline(Dumper);
835835 CVSymbolVisitor Visitor(Pipeline);
836 if (auto EC = Visitor.visitSymbolStream(ModS.getSymbolArray())) {
836 auto SS = ModS.getSymbolsSubstream();
837 if (auto EC = Visitor.visitSymbolStream(ModS.getSymbolArray(), SS.Offset)) {
837838 P.formatLine("Error while processing symbol records. {0}",
838839 toString(std::move(EC)));
839840 continue;
862863 Pipeline.addCallbackToPipeline(Deserializer);
863864 Pipeline.addCallbackToPipeline(Dumper);
864865 CVSymbolVisitor Visitor(Pipeline);
866
865867 auto ExpectedSymbols = Publics.getSymbolArray();
866868 if (!ExpectedSymbols) {
867869 P.formatLine("Could not read public symbol record stream");
868870 return Error::success();
869871 }
870872
871 if (auto EC = Visitor.visitSymbolStream(*ExpectedSymbols))
873 if (auto EC = Visitor.visitSymbolStream(*ExpectedSymbols, 0))
872874 P.formatLine("Error while processing public symbol records. {0}",
873875 toString(std::move(EC)));
874876
366366 }
367367
368368 Error MinimalSymbolDumper::visitSymbolBegin(codeview::CVSymbol &Record) {
369 return visitSymbolBegin(Record, 0);
370 }
371
372 Error MinimalSymbolDumper::visitSymbolBegin(codeview::CVSymbol &Record,
373 uint32_t Offset) {
369374 // formatLine puts the newline at the beginning, so we use formatLine here
370375 // to start a new line, and then individual visit methods use format to
371376 // append to the existing line.
372 P.formatLine("- {0} [size = {1}]", getSymbolKindName(Record.Type),
373 Record.length());
377 P.formatLine("{0} | {1} [size = {2}]",
378 fmt_align(Offset, AlignStyle::Right, 6),
379 getSymbolKindName(Record.Type), Record.length());
374380 P.Indent();
375381 return Error::success();
376382 }
393399
394400 Error MinimalSymbolDumper::visitKnownRecord(CVSymbol &CVR, BlockSym &Block) {
395401 P.format(" `{0}`", Block.Name);
396 AutoIndent Indent(P);
397 P.formatLine("parent = {0}, addr = {1}", Block.Parent,
402 AutoIndent Indent(P, 7);
403 ;
404 P.formatLine("parent = {0}, end = {1}", Block.Parent, Block.End);
405 P.formatLine("code size = {0}, addr = {1}", Block.CodeSize,
398406 formatSegmentOffset(Block.Segment, Block.CodeOffset));
399 P.formatLine("code size = {0}, end = {1}", Block.CodeSize, Block.End);
400407 return Error::success();
401408 }
402409
403410 Error MinimalSymbolDumper::visitKnownRecord(CVSymbol &CVR, Thunk32Sym &Thunk) {
404411 P.format(" `{0}`", Thunk.Name);
405 AutoIndent Indent(P);
406 P.formatLine("parent = {0}, addr = {1}", Thunk.Parent,
412 AutoIndent Indent(P, 7);
413 ;
414 P.formatLine("parent = {0}, end = {1}, next = {2}", Thunk.Parent, Thunk.End,
415 Thunk.Next);
416 P.formatLine("kind = {0}, size = {1}, addr = {2}",
417 formatThunkOrdinal(Thunk.Thunk), Thunk.Length,
407418 formatSegmentOffset(Thunk.Segment, Thunk.Offset));
408 P.formatLine("kind = {0}, size = {1}, end = {2}, next = {3}",
409 formatThunkOrdinal(Thunk.Thunk), Thunk.Length, Thunk.End,
410 Thunk.Next);
411419
412420 return Error::success();
413421 }
414422
415423 Error MinimalSymbolDumper::visitKnownRecord(CVSymbol &CVR,
416424 TrampolineSym &Tramp) {
417 AutoIndent Indent(P);
425 AutoIndent Indent(P, 7);
426 ;
418427 P.formatLine("type = {0}, size = {1}, source = {2}, target = {3}",
419428 formatTrampolineType(Tramp.Type), Tramp.Size,
420429 formatSegmentOffset(Tramp.ThunkSection, Tramp.ThunkOffset),
426435 Error MinimalSymbolDumper::visitKnownRecord(CVSymbol &CVR,
427436 SectionSym &Section) {
428437 P.format(" `{0}`", Section.Name);
429 AutoIndent Indent(P);
438 AutoIndent Indent(P, 7);
439 ;
430440 P.formatLine("length = {0}, alignment = {1}, rva = {2}, section # = {3}, "
431441 "characteristics = {4}",
432442 Section.Length, Section.Alignment, Section.Rva,
436446
437447 Error MinimalSymbolDumper::visitKnownRecord(CVSymbol &CVR, CoffGroupSym &CG) {
438448 P.format(" `{0}`", CG.Name);
439 AutoIndent Indent(P);
449 AutoIndent Indent(P, 7);
450 ;
440451 P.formatLine("length = {0}, addr = {1}, characteristics = {2}", CG.Size,
441452 formatSegmentOffset(CG.Segment, CG.Offset), CG.Characteristics);
442453 return Error::success();
445456 Error MinimalSymbolDumper::visitKnownRecord(CVSymbol &CVR,
446457 BPRelativeSym &BPRel) {
447458 P.format(" `{0}`", BPRel.Name);
448 AutoIndent Indent(P);
459 AutoIndent Indent(P, 7);
460 ;
449461 P.formatLine("type = {0}, offset = {1}", typeIndex(BPRel.Type), BPRel.Offset);
450462 return Error::success();
451463 }
458470
459471 Error MinimalSymbolDumper::visitKnownRecord(CVSymbol &CVR,
460472 CallSiteInfoSym &CSI) {
461 AutoIndent Indent(P);
473 AutoIndent Indent(P, 7);
474 ;
462475 P.formatLine("type = {0}, addr = {1}", typeIndex(CSI.Type),
463476 formatSegmentOffset(CSI.Segment, CSI.CodeOffset));
464477 return Error::success();
466479
467480 Error MinimalSymbolDumper::visitKnownRecord(CVSymbol &CVR,
468481 EnvBlockSym &EnvBlock) {
482 AutoIndent Indent(P, 7);
483 ;
469484 for (const auto &Entry : EnvBlock.Fields) {
470485 P.formatLine("- {0}", Entry);
471486 }
474489
475490 Error MinimalSymbolDumper::visitKnownRecord(CVSymbol &CVR, FileStaticSym &FS) {
476491 P.format(" `{0}`", FS.Name);
477 AutoIndent Indent(P);
492 AutoIndent Indent(P, 7);
493 ;
478494 P.formatLine("type = {0}, file name offset = {1}, flags = {2}",
479495 typeIndex(FS.Index), FS.ModFilenameOffset,
480496 formatLocalSymFlags(P.getIndentLevel() + 9, FS.Flags));
483499
484500 Error MinimalSymbolDumper::visitKnownRecord(CVSymbol &CVR, ExportSym &Export) {
485501 P.format(" `{0}`", Export.Name);
486 AutoIndent Indent(P);
502 AutoIndent Indent(P, 7);
503 ;
487504 P.formatLine("ordinal = {0}, flags = {1}", Export.Ordinal,
488505 formatExportFlags(P.getIndentLevel() + 9, Export.Flags));
489506 return Error::success();
491508
492509 Error MinimalSymbolDumper::visitKnownRecord(CVSymbol &CVR,
493510 Compile2Sym &Compile2) {
494 AutoIndent Indent(P);
511 AutoIndent Indent(P, 7);
512 ;
495513 SourceLanguage Lang = static_cast(
496514 Compile2.Flags & CompileSym2Flags::SourceLanguageMask);
497515 P.formatLine("machine = {0}, ver = {1}, language = {2}",
511529
512530 Error MinimalSymbolDumper::visitKnownRecord(CVSymbol &CVR,
513531 Compile3Sym &Compile3) {
514 AutoIndent Indent(P);
532 AutoIndent Indent(P, 7);
533 ;
515534 SourceLanguage Lang = static_cast(
516535 Compile3.Flags & CompileSym3Flags::SourceLanguageMask);
517536 P.formatLine("machine = {0}, Ver = {1}, language = {2}",
530549 Error MinimalSymbolDumper::visitKnownRecord(CVSymbol &CVR,
531550 ConstantSym &Constant) {
532551 P.format(" `{0}`", Constant.Name);
533 AutoIndent Indent(P);
552 AutoIndent Indent(P, 7);
553 ;
534554 P.formatLine("type = {0}, value = {1}", typeIndex(Constant.Type),
535555 Constant.Value.toString(10));
536556 return Error::success();
538558
539559 Error MinimalSymbolDumper::visitKnownRecord(CVSymbol &CVR, DataSym &Data) {
540560 P.format(" `{0}`", Data.Name);
541 AutoIndent Indent(P);
561 AutoIndent Indent(P, 7);
562 ;
542563 P.formatLine("type = {0}, addr = {1}", typeIndex(Data.Type),
543564 formatSegmentOffset(Data.Segment, Data.DataOffset));
544565 return Error::success();
552573
553574 Error MinimalSymbolDumper::visitKnownRecord(CVSymbol &CVR,
554575 DefRangeFramePointerRelSym &Def) {
555 AutoIndent Indent(P);
576 AutoIndent Indent(P, 7);
577 ;
556578 P.formatLine("offset = {0}, range = {1}", Def.Offset, formatRange(Def.Range));
557579 P.formatLine("gaps = {2}", Def.Offset,
558580 formatGaps(P.getIndentLevel() + 9, Def.Gaps));
561583
562584 Error MinimalSymbolDumper::visitKnownRecord(CVSymbol &CVR,
563585 DefRangeRegisterRelSym &Def) {
564 AutoIndent Indent(P);
586 AutoIndent Indent(P, 7);
587 ;
565588 P.formatLine("register = {0}, base ptr = {1}, offset in parent = {2}, has "
566589 "spilled udt = {3}",
567590 uint16_t(Def.Hdr.Register), int32_t(Def.Hdr.BasePointerOffset),
573596
574597 Error MinimalSymbolDumper::visitKnownRecord(
575598 CVSymbol &CVR, DefRangeRegisterSym &DefRangeRegister) {
576 AutoIndent Indent(P);
599 AutoIndent Indent(P, 7);
600 ;
577601 P.formatLine("register = {0}, may have no name = {1}, range start = "
578602 "{2}, length = {3}",
579603 uint16_t(DefRangeRegister.Hdr.Register),
588612
589613 Error MinimalSymbolDumper::visitKnownRecord(CVSymbol &CVR,
590614 DefRangeSubfieldRegisterSym &Def) {
591 AutoIndent Indent(P);
615 AutoIndent Indent(P, 7);
616 ;
592617 bool NoName = !!(Def.Hdr.MayHaveNoName == 0);
593618 P.formatLine("register = {0}, may have no name = {1}, offset in parent = {2}",
594619 uint16_t(Def.Hdr.Register), NoName,
600625
601626 Error MinimalSymbolDumper::visitKnownRecord(CVSymbol &CVR,
602627 DefRangeSubfieldSym &Def) {
603 AutoIndent Indent(P);
628 AutoIndent Indent(P, 7);
629 ;
604630 P.formatLine("program = {0}, offset in parent = {1}, range = {2}",
605631 Def.Program, Def.OffsetInParent, formatRange(Def.Range));
606632 P.formatLine("gaps = {0}", formatGaps(P.getIndentLevel() + 9, Def.Gaps));
608634 }
609635
610636 Error MinimalSymbolDumper::visitKnownRecord(CVSymbol &CVR, DefRangeSym &Def) {
611 AutoIndent Indent(P);
637 AutoIndent Indent(P, 7);
638 ;
612639 P.formatLine("program = {0}, range = {1}", Def.Program,
613640 formatRange(Def.Range));
614641 P.formatLine("gaps = {0}", formatGaps(P.getIndentLevel() + 9, Def.Gaps));
616643 }
617644
618645 Error MinimalSymbolDumper::visitKnownRecord(CVSymbol &CVR, FrameCookieSym &FC) {
619 AutoIndent Indent(P);
646 AutoIndent Indent(P, 7);
647 ;
620648 P.formatLine("code offset = {0}, Register = {1}, kind = {2}, flags = {3}",
621649 FC.CodeOffset, FC.Register, formatCookieKind(FC.CookieKind),
622650 FC.Flags);
624652 }
625653
626654 Error MinimalSymbolDumper::visitKnownRecord(CVSymbol &CVR, FrameProcSym &FP) {
627 AutoIndent Indent(P);
655 AutoIndent Indent(P, 7);
656 ;
628657 P.formatLine("size = {0}, padding size = {1}, offset to padding = {2}",
629658 FP.TotalFrameBytes, FP.PaddingFrameBytes, FP.OffsetToPadding);
630659 P.formatLine("bytes of callee saved registers = {0}, exception handler addr "
639668
640669 Error MinimalSymbolDumper::visitKnownRecord(CVSymbol &CVR,
641670 HeapAllocationSiteSym &HAS) {
642 AutoIndent Indent(P);
671 AutoIndent Indent(P, 7);
672 ;
643673 P.formatLine("type = {0}, addr = {1} call size = {2}", typeIndex(HAS.Type),
644674 formatSegmentOffset(HAS.Segment, HAS.CodeOffset),
645675 HAS.CallInstructionSize);
647677 }
648678
649679 Error MinimalSymbolDumper::visitKnownRecord(CVSymbol &CVR, InlineSiteSym &IS) {
650 AutoIndent Indent(P);
680 AutoIndent Indent(P, 7);
681 ;
651682 auto Bytes = makeArrayRef(IS.AnnotationData);
652683 StringRef Annotations(reinterpret_cast(Bytes.begin()),
653684 Bytes.size());
661692 Error MinimalSymbolDumper::visitKnownRecord(CVSymbol &CVR,
662693 RegisterSym &Register) {
663694 P.format(" `{0}`", Register.Name);
664 AutoIndent Indent(P);
695 AutoIndent Indent(P, 7);
696 ;
665697 P.formatLine("register = {0}, type = {1}",
666698 formatRegisterId(Register.Register), typeIndex(Register.Index));
667699 return Error::success();
670702 Error MinimalSymbolDumper::visitKnownRecord(CVSymbol &CVR,
671703 PublicSym32 &Public) {
672704 P.format(" `{0}`", Public.Name);
673 AutoIndent Indent(P);
705 AutoIndent Indent(P, 7);
706 ;
674707 P.formatLine("flags = {0}, addr = {1}",
675708 formatPublicSymFlags(P.getIndentLevel() + 9, Public.Flags),
676709 formatSegmentOffset(Public.Segment, Public.Offset));
679712
680713 Error MinimalSymbolDumper::visitKnownRecord(CVSymbol &CVR, ProcRefSym &PR) {
681714 P.format(" `{0}`", PR.Name);
682 AutoIndent Indent(P);
715 AutoIndent Indent(P, 7);
716 ;
683717 P.formatLine("module = {0}, sum name = {1}, offset = {2}", PR.Module,
684718 PR.SumName, PR.SymOffset);
685719 return Error::success();
688722 Error MinimalSymbolDumper::visitKnownRecord(CVSymbol &CVR, LabelSym &Label) {
689723 P.format(" `{0}` (addr = {1})", Label.Name,
690724 formatSegmentOffset(Label.Segment, Label.CodeOffset));
691 AutoIndent Indent(P);
725 AutoIndent Indent(P, 7);
726 ;
692727 P.formatLine("flags = {0}",
693728 formatProcSymFlags(P.getIndentLevel() + 9, Label.Flags));
694729 return Error::success();
696731
697732 Error MinimalSymbolDumper::visitKnownRecord(CVSymbol &CVR, LocalSym &Local) {
698733 P.format(" `{0}`", Local.Name);
699 AutoIndent Indent(P);
734 AutoIndent Indent(P, 7);
735 ;
700736
701737 std::string FlagStr =
702738 formatLocalSymFlags(P.getIndentLevel() + 9, Local.Flags);
712748
713749 Error MinimalSymbolDumper::visitKnownRecord(CVSymbol &CVR, ProcSym &Proc) {
714750 P.format(" `{0}`", Proc.Name);
715 AutoIndent Indent(P);
716 P.formatLine("parent = {0}, addr = {1}, code size = {2}, end = {3}",
717 Proc.Parent, formatSegmentOffset(Proc.Segment, Proc.CodeOffset),
718 Proc.CodeSize, Proc.End);
751 AutoIndent Indent(P, 7);
752 ;
753 P.formatLine("parent = {0}, end = {1}, addr = {2}, code size = {3}",
754 Proc.Parent, Proc.End,
755 formatSegmentOffset(Proc.Segment, Proc.CodeOffset),
756 Proc.CodeSize);
719757 P.formatLine("debug start = {0}, debug end = {1}, flags = {2}", Proc.DbgStart,
720758 Proc.DbgEnd,
721759 formatProcSymFlags(P.getIndentLevel() + 9, Proc.Flags));
728766 }
729767
730768 Error MinimalSymbolDumper::visitKnownRecord(CVSymbol &CVR, CallerSym &Caller) {
731 AutoIndent Indent(P);
769 AutoIndent Indent(P, 7);
770 ;
732771 for (const auto &I : Caller.Indices) {
733772 P.formatLine("callee: {0}", typeIndex(I));
734773 }
738777 Error MinimalSymbolDumper::visitKnownRecord(CVSymbol &CVR,
739778 RegRelativeSym &RegRel) {
740779 P.format(" `{0}`", RegRel.Name);
741 AutoIndent Indent(P);
780 AutoIndent Indent(P, 7);
781 ;
742782 P.formatLine("type = {0}, register = {1}, offset = {2}",
743783 typeIndex(RegRel.Type), formatRegisterId(RegRel.Register),
744784 RegRel.Offset);
748788 Error MinimalSymbolDumper::visitKnownRecord(CVSymbol &CVR,
749789 ThreadLocalDataSym &Data) {
750790 P.format(" `{0}`", Data.Name);
751 AutoIndent Indent(P);
791 AutoIndent Indent(P, 7);
792 ;
752793 P.formatLine("type = {0}, addr = {1}", typeIndex(Data.Type),
753794 formatSegmentOffset(Data.Segment, Data.DataOffset));
754795 return Error::success();
756797
757798 Error MinimalSymbolDumper::visitKnownRecord(CVSymbol &CVR, UDTSym &UDT) {
758799 P.format(" `{0}`", UDT.Name);
759 AutoIndent Indent(P);
800 AutoIndent Indent(P, 7);
801 ;
760802 P.formatLine("original type = {0}", UDT.Type);
761803 return Error::success();
762804 }
2626 : P(P), Types(Types) {}
2727
2828 Error visitSymbolBegin(codeview::CVSymbol &Record) override;
29 Error visitSymbolBegin(codeview::CVSymbol &Record, uint32_t Offset) override;
2930 Error visitSymbolEnd(codeview::CVSymbol &Record) override;
3031
3132 #define SYMBOL_RECORD(EnumName, EnumVal, Name) \