llvm.org GIT mirror llvm / 3a06c2d
Revert "[llvm-readobj] Simplify usage of -codeview flag" This reverts commit r255790. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@255791 91177308-0d34-0410-b5e6-96231b3b80d8 Reid Kleckner 4 years ago
3 changed file(s) with 7 addition(s) and 16 deletion(s). Raw diff Collapse all Expand all
5959 void printCOFFExports() override;
6060 void printCOFFDirectives() override;
6161 void printCOFFBaseReloc() override;
62 void printCodeViewDebugInfo() override;
6362 void printStackMap() const override;
6463 private:
6564 void printSymbol(const SymbolRef &Sym);
7170 void printBaseOfDataField(const pe32_header *Hdr);
7271 void printBaseOfDataField(const pe32plus_header *Hdr);
7372
74 void printCodeViewSection(const SectionRef &Section);
73 void printCodeViewDebugInfo(const SectionRef &Section);
7574
7675 void printCodeViewSymbolsSubsection(StringRef Subsection,
7776 const SectionRef &Section,
474473
475474 void COFFDumper::printBaseOfDataField(const pe32plus_header *) {}
476475
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) {
476 void COFFDumper::printCodeViewDebugInfo(const SectionRef &Section) {
487477 StringRef Data;
488478 error(Section.getContents(Data));
489479
525515
526516 switch (SubSectionType) {
527517 case COFF::DEBUG_SYMBOL_SUBSECTION:
528 printCodeViewSymbolsSubsection(Contents, Section, Offset);
518 if (opts::SectionSymbols)
519 printCodeViewSymbolsSubsection(Contents, Section, Offset);
529520 break;
530521 case COFF::DEBUG_LINE_TABLE_SUBSECTION: {
531522 // Holds a PC to file:line table. Some data to parse this subsection is
785776 }
786777 }
787778
779 if (Name == ".debug$S" && opts::CodeView)
780 printCodeViewDebugInfo(Sec);
781
788782 if (opts::SectionData &&
789783 !(Section->Characteristics & COFF::IMAGE_SCN_CNT_UNINITIALIZED_DATA)) {
790784 StringRef Data;
5555 virtual void printCOFFExports() { }
5656 virtual void printCOFFDirectives() { }
5757 virtual void printCOFFBaseReloc() { }
58 virtual void printCodeViewDebugInfo() { }
5958
6059 // Only implemented for MachO.
6160 virtual void printMachODataInCode() { }
353353 Dumper->printCOFFDirectives();
354354 if (opts::COFFBaseRelocs)
355355 Dumper->printCOFFBaseReloc();
356 if (opts::CodeView)
357 Dumper->printCodeViewDebugInfo();
358356 }
359357 if (Obj->isMachO()) {
360358 if (opts::MachODataInCode)