[DebugInfo] Report the format of call frame information entries [6/10]

Differential Revision: https://reviews.llvm.org/D80523
This commit is contained in:
Igor Kudrin 2020-06-02 16:00:44 +07:00
parent 2ea94c8a42
commit 4933ab2ccb
10 changed files with 25 additions and 3 deletions

View File

@ -6,6 +6,7 @@
// CHECK: .eh_frame contents:
// CHECK: 00000000 0000001c 00000000 CIE
// CHECK-NEXT: Format: DWARF32
// CHECK-NEXT: Version: 1
// CHECK-NEXT: Augmentation: "zPLR"
// CHECK-NEXT: Code alignment factor: 1
@ -20,6 +21,7 @@
// CHECK-NEXT: DW_CFA_nop:
// CHECK: 00000020 00000014 00000024 FDE cie=00000000 pc=00001014...00001014
// CHECK-NEXT: Format: DWARF32
// CHECK-NEXT: LSDA Address: 000000000000100b
// CHECK-NEXT: DW_CFA_nop:
// CHECK-NEXT: DW_CFA_nop:

View File

@ -482,6 +482,7 @@ StringRef GDBIndexEntryKindString(GDBIndexEntryKind Kind);
StringRef GDBIndexEntryLinkageString(GDBIndexEntryLinkage Linkage);
StringRef IndexString(unsigned Idx);
StringRef FormatString(DwarfFormat Format);
StringRef FormatString(bool IsDWARF64);
/// @}
/// \defgroup DwarfConstantsParsing Dwarf constants parsing functions

View File

@ -780,6 +780,10 @@ StringRef llvm::dwarf::FormatString(DwarfFormat Format) {
return StringRef();
}
StringRef llvm::dwarf::FormatString(bool IsDWARF64) {
return FormatString(IsDWARF64 ? DWARF64 : DWARF32);
}
constexpr char llvm::dwarf::EnumTraits<Attribute>::Type[];
constexpr char llvm::dwarf::EnumTraits<Form>::Type[];
constexpr char llvm::dwarf::EnumTraits<Index>::Type[];

View File

@ -314,9 +314,10 @@ void CIE::dump(raw_ostream &OS, const MCRegisterInfo *MRI, bool IsEH) const {
<< format(" %0*" PRIx64, IsDWARF64 ? 16 : 8, Length)
<< format(" %0*" PRIx64, IsDWARF64 && !IsEH ? 16 : 8,
getCIEId(IsDWARF64, IsEH))
<< " CIE\n";
OS << format(" Version: %d\n", Version);
OS << " Augmentation: \"" << Augmentation << "\"\n";
<< " CIE\n"
<< " Format: " << FormatString(IsDWARF64) << "\n"
<< format(" Version: %d\n", Version)
<< " Augmentation: \"" << Augmentation << "\"\n";
if (Version >= 4) {
OS << format(" Address size: %u\n", (uint32_t)AddressSize);
OS << format(" Segment desc size: %u\n",
@ -349,6 +350,7 @@ void FDE::dump(raw_ostream &OS, const MCRegisterInfo *MRI, bool IsEH) const {
OS << "<invalid offset>";
OS << format(" pc=%08" PRIx64 "...%08" PRIx64 "\n", InitialLocation,
InitialLocation + AddressRange);
OS << " Format: " << FormatString(IsDWARF64) << "\n";
if (LSDAAddress)
OS << format(" LSDA Address: %016" PRIx64 "\n", *LSDAAddress);
CFIs.dump(OS, MRI, IsEH);

View File

@ -3,6 +3,7 @@
# RUN: FileCheck %s
# CHECK: 00000000 0000000000000010 ffffffffffffffff CIE
# CHECK-NEXT: Format: DWARF64
# CHECK-NEXT: Version: 4
# CHECK-NEXT: Augmentation: ""
# CHECK-NEXT: Address size: 8
@ -14,6 +15,7 @@
# CHECK-NEXT: DW_CFA_nop:
# CHECK: 0000001c 0000000000000018 0000000000000000 FDE cie=00000000 pc=00112233...00122233
# CHECK-NEXT: Format: DWARF64
.section .debug_frame, "", @progbits
.LCIE:

View File

@ -55,6 +55,7 @@ func:
// RELOCS-NEXT: }
// DWARF32: 00000000 00000010 00000000 CIE
// DWARF32-NEXT: Format: DWARF32
// DWARF32-NEXT: Version: 1
// DWARF32-NEXT: Augmentation: "zR"
// DWARF32-NEXT: Code alignment factor: 1
@ -68,12 +69,14 @@ func:
// DWARF32-NEXT: DW_CFA_def_cfa_register: reg29
//
// DWARF32: 00000014 00000010 00000018 FDE cie=00000000 pc=00000000...00000000
// DWARF32-NEXT: Format: DWARF32
// DWARF32-NEXT: DW_CFA_nop:
// DWARF32-NEXT: DW_CFA_nop:
// DWARF32-NEXT: DW_CFA_nop:
// DWARF64: 00000000 00000010 00000000 CIE
// DWARF64-NEXT: Format: DWARF32
// DWARF64-NEXT: Version: 1
// DWARF64-NEXT: Augmentation: "zR"
// DWARF64-NEXT: Code alignment factor: 1
@ -91,6 +94,7 @@ func:
//
// DWARF64_ABS: 00000014 00000018 00000018 FDE cie=00000000 pc=00000000...00000000
// DWARF64_PIC: 00000014 00000010 00000018 FDE cie=00000000 pc=00000000...00000000
// DWARF64-NEXT: Format: DWARF32
// DWARF64-NEXT: DW_CFA_nop:
// DWARF64-NEXT: DW_CFA_nop:
// DWARF64-NEXT: DW_CFA_nop:

View File

@ -27,6 +27,7 @@ objects:
# CHECK: .debug_frame contents:
# CHECK: 00000000 {{[0-9a-f]*}} ffffffff CIE
# CHECK-NEXT: Format: DWARF32
# CHECK-NEXT: Version:{{.*}}1
# CHECK-NOT: FDE
# CHECK: FDE cie=00000000 pc=00001000...00001
@ -34,11 +35,13 @@ objects:
# CHECK: FDE cie=00000000 pc=00002000...00002
# CHECK-NOT: FDE
# CHECK: [[CIEDW4:[0-9a-f]*]] 00000010 ffffffff CIE
# CHECK-NEXT: Format: DWARF32
# CHECK-NEXT: Version:{{.*}}4
# CHECK-NOT: FDE
# CHECK: FDE cie=[[CIEDW4]] pc=00003000...00003
# CHECK-NOT: FDE
# CHECK: [[CIEDW2:[0-9a-f]*]] {{[0-9a-f]*}} ffffffff CIE
# CHECK-NEXT: Format: DWARF32
# CHECK-NEXT: Version:{{.*}}1
# CHECK-NOT: FDE
# CHECK: FDE cie=[[CIEDW2]] pc=00004000...00004

View File

@ -3,6 +3,7 @@
# CHECK: .eh_frame contents:
# CHECK: 00000018 00000010 0000001c FDE cie=00000000 pc=00000000...00000000
# CHECK-NEXT: Format: DWARF32
# CHECK-NEXT: DW_CFA_GNU_args_size: +16
# CHECK-NEXT: DW_CFA_nop:

View File

@ -2,6 +2,7 @@ RUN: llc -filetype=obj %p/../../dsymutil/Inputs/frame-dw2.ll -o - \
RUN: | llvm-dwarfdump -debug-frame=0x00000014 - | FileCheck %s
CHECK: .debug_frame contents:
CHECK-NEXT: 00000014 00000014 00000000 FDE cie=00000000 pc=00000000...0000001d
CHECK-NEXT: Format: DWARF32
CHECK-NEXT: DW_CFA_advance_loc: 1
CHECK-NOT: pc
@ -9,6 +10,7 @@ RUN: llvm-dwarfdump %p/../../dsymutil/Inputs/basic1.macho.x86_64.o \
RUN: -eh-frame=0x00000018 | FileCheck %s --check-prefix=EH
EH: .eh_frame contents:
EH-NEXT: 00000018 00000024 0000001c FDE cie=00000000 pc=fffffffffffffd00...fffffffffffffd24
EH-NEXT: Format: DWARF32
EH-NEXT: DW_CFA_advance_loc: 1
EH-NOT: pc
EH-NOT: CIE

View File

@ -11,6 +11,7 @@
# CHECK: .eh_frame contents:
# CHECK: 00000000 00000010 00000000 CIE
# CHECK-NEXT: Format: DWARF32
# CHECK-NEXT: Version: 1
# CHECK-NEXT: Augmentation: "zR"
# CHECK-NEXT: Code alignment factor: 1