llvm.org GIT mirror llvm / 377b54c
[llvm-readobj] Simplify usage of -codeview flag git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@255790 91177308-0d34-0410-b5e6-96231b3b80d8 Reid Kleckner 4 years ago
3 changed file(s) with 16 addition(s) and 7 deletion(s). Raw diff Collapse all Expand all
5959 void printCOFFExports() override;
6060 void printCOFFDirectives() override;
6161 void printCOFFBaseReloc() override;
62 void printCodeViewDebugInfo() override;
6263 void printStackMap() const override;
6364 private:
6465 void printSymbol(const SymbolRef &Sym);
7071 void printBaseOfDataField(const pe32_header *Hdr);
7172 void printBaseOfDataField(const pe32plus_header *Hdr);
7273
73 void printCodeViewDebugInfo(const SectionRef &Section);
74 void printCodeViewSection(const SectionRef &Section);
7475
7576 void printCodeViewSymbolsSubsection(StringRef Subsection,
7677 const SectionRef &Section,
473474
474475 void COFFDumper::printBaseOfDataField(const pe32plus_header *) {}
475476
476 void COFFDumper::printCodeViewDebugInfo(const SectionRef &Section) {
477 void COFFDumper::printCodeViewDebugInfo() {
478 for (const SectionRef &S : Obj->sections()) {
479 StringRef SecName;
480 error(S.getName(SecName));
481 if (SecName == ".debug$S")
482 printCodeViewSection(S);
483 }
484 }
485
486 void COFFDumper::printCodeViewSection(const SectionRef &Section) {
477487 StringRef Data;
478488 error(Section.getContents(Data));
479489
515525
516526 switch (SubSectionType) {
517527 case COFF::DEBUG_SYMBOL_SUBSECTION:
518 if (opts::SectionSymbols)
519 printCodeViewSymbolsSubsection(Contents, Section, Offset);
528 printCodeViewSymbolsSubsection(Contents, Section, Offset);
520529 break;
521530 case COFF::DEBUG_LINE_TABLE_SUBSECTION: {
522531 // Holds a PC to file:line table. Some data to parse this subsection is
776785 }
777786 }
778787
779 if (Name == ".debug$S" && opts::CodeView)
780 printCodeViewDebugInfo(Sec);
781
782788 if (opts::SectionData &&
783789 !(Section->Characteristics & COFF::IMAGE_SCN_CNT_UNINITIALIZED_DATA)) {
784790 StringRef Data;
5555 virtual void printCOFFExports() { }
5656 virtual void printCOFFDirectives() { }
5757 virtual void printCOFFBaseReloc() { }
58 virtual void printCodeViewDebugInfo() { }
5859
5960 // Only implemented for MachO.
6061 virtual void printMachODataInCode() { }
353353 Dumper->printCOFFDirectives();
354354 if (opts::COFFBaseRelocs)
355355 Dumper->printCOFFBaseReloc();
356 if (opts::CodeView)
357 Dumper->printCodeViewDebugInfo();
356358 }
357359 if (Obj->isMachO()) {
358360 if (opts::MachODataInCode)