; RUN: llc -mcpu=core2 -mtriple=i686-pc-win32 -O0 < %s | FileCheck --check-prefix=X86 %s
-; RUN: llc -mcpu=core2 -mtriple=i686-pc-win32 -o - -O0 < %s | llvm-mc -triple=i686-pc-win32 -filetype=obj | llvm-readobj -s -sr -codeview -section-symbols | FileCheck --check-prefix=OBJ32 %s
+; RUN: llc -mcpu=core2 -mtriple=i686-pc-win32 -o - -O0 < %s | llvm-mc -triple=i686-pc-win32 -filetype=obj | llvm-readobj -s -sr -codeview | FileCheck --check-prefix=OBJ32 %s
; RUN: llc -mcpu=core2 -mtriple=x86_64-pc-win32 -O0 < %s | FileCheck --check-prefix=X64 %s
-; RUN: llc -mcpu=core2 -mtriple=x86_64-pc-win32 -o - -O0 < %s | llvm-mc -triple=x86_64-pc-win32 -filetype=obj | llvm-readobj -s -sr -codeview -section-symbols | FileCheck --check-prefix=OBJ64 %s
+; RUN: llc -mcpu=core2 -mtriple=x86_64-pc-win32 -o - -O0 < %s | llvm-mc -triple=x86_64-pc-win32 -filetype=obj | llvm-readobj -s -sr -codeview | FileCheck --check-prefix=OBJ64 %s
; This LL file was generated by running clang on the following code:
; D:\asm.c:
; OBJ32-NEXT: 0x44 IMAGE_REL_I386_SECREL _f
; OBJ32-NEXT: 0x48 IMAGE_REL_I386_SECTION _f
; OBJ32-NEXT: ]
+; OBJ32: CodeViewDebugInfo [
; OBJ32: Subsection [
; OBJ32-NEXT: Type: 0xF1
; OBJ32-NOT: ]
; OBJ32-NEXT: ColEnd: 0
; OBJ32-NEXT: ]
; OBJ32-NEXT: ]
-; OBJ32: }
; X64-LABEL: f:
; X64-NEXT: .L{{.*}}:{{$}}
; OBJ64-NEXT: ColEnd: 0
; OBJ64-NEXT: ]
; OBJ64-NEXT: ]
-; OBJ64: }
; Function Attrs: nounwind
define void @f() #0 !dbg !4 {
void printCOFFExports() override;
void printCOFFDirectives() override;
void printCOFFBaseReloc() override;
+ void printCodeViewDebugInfo() override;
void printStackMap() const override;
private:
void printSymbol(const SymbolRef &Sym);
void printBaseOfDataField(const pe32_header *Hdr);
void printBaseOfDataField(const pe32plus_header *Hdr);
- void printCodeViewDebugInfo(const SectionRef &Section);
+ void printCodeViewSection(const SectionRef &Section);
void printCodeViewSymbolsSubsection(StringRef Subsection,
const SectionRef &Section,
void COFFDumper::printBaseOfDataField(const pe32plus_header *) {}
-void COFFDumper::printCodeViewDebugInfo(const SectionRef &Section) {
+void COFFDumper::printCodeViewDebugInfo() {
+ for (const SectionRef &S : Obj->sections()) {
+ StringRef SecName;
+ error(S.getName(SecName));
+ if (SecName == ".debug$S")
+ printCodeViewSection(S);
+ }
+}
+
+void COFFDumper::printCodeViewSection(const SectionRef &Section) {
StringRef Data;
error(Section.getContents(Data));
switch (SubSectionType) {
case COFF::DEBUG_SYMBOL_SUBSECTION:
- if (opts::SectionSymbols)
- printCodeViewSymbolsSubsection(Contents, Section, Offset);
+ printCodeViewSymbolsSubsection(Contents, Section, Offset);
break;
case COFF::DEBUG_LINE_TABLE_SUBSECTION: {
// Holds a PC to file:line table. Some data to parse this subsection is
}
}
- if (Name == ".debug$S" && opts::CodeView)
- printCodeViewDebugInfo(Sec);
-
if (opts::SectionData &&
!(Section->Characteristics & COFF::IMAGE_SCN_CNT_UNINITIALIZED_DATA)) {
StringRef Data;