[llvm] 2ba4df6 - [DebugInfo] Fix dumping CIE ID in .eh_frame sections.
Igor Kudrin via llvm-commits
llvm-commits at lists.llvm.org
Thu Feb 13 00:45:45 PST 2020
Author: Igor Kudrin
Date: 2020-02-13T15:42:14+07:00
New Revision: 2ba4df6c1177bd279ae3111ef2e0b0130faa3ead
URL: https://github.com/llvm/llvm-project/commit/2ba4df6c1177bd279ae3111ef2e0b0130faa3ead
DIFF: https://github.com/llvm/llvm-project/commit/2ba4df6c1177bd279ae3111ef2e0b0130faa3ead.diff
LOG: [DebugInfo] Fix dumping CIE ID in .eh_frame sections.
We do not keep the actual value of the CIE ID field, because it is
predefined, and use a constant when dumping a CIE record. The issue
was that the predefined value is different for .debug_frame and
.eh_frame sections, but we always printed the one which corresponds
to .debug_frame. The patch fixes that by choosing an appropriate
constant to print.
See the following for more information about .eh_frame sections:
https://refspecs.linuxfoundation.org/LSB_5.0.0/LSB-Core-generic/LSB-Core-generic/ehframechpt.html
Differential Revision: https://reviews.llvm.org/D73627
Added:
Modified:
lld/test/ELF/eh-frame-hdr-augmentation.s
llvm/lib/DebugInfo/DWARF/DWARFDebugFrame.cpp
llvm/test/DebugInfo/RISCV/eh-frame.s
llvm/test/MC/Mips/eh-frame.s
llvm/test/MC/X86/return-column.s
llvm/test/tools/llvm-dwarfdump/X86/eh-frame-return-address-reg.s
llvm/test/tools/llvm-objdump/eh_frame-arm64.test
llvm/test/tools/llvm-objdump/eh_frame-coff.test
llvm/test/tools/llvm-objdump/eh_frame-mipsel.test
llvm/test/tools/llvm-objdump/eh_frame_zero_cie.test
Removed:
################################################################################
diff --git a/lld/test/ELF/eh-frame-hdr-augmentation.s b/lld/test/ELF/eh-frame-hdr-augmentation.s
index a87a6e2a3f68..9af5336e40e0 100644
--- a/lld/test/ELF/eh-frame-hdr-augmentation.s
+++ b/lld/test/ELF/eh-frame-hdr-augmentation.s
@@ -5,7 +5,7 @@
// CHECK: .eh_frame contents:
-// CHECK: 00000000 0000001c ffffffff CIE
+// CHECK: 00000000 0000001c 00000000 CIE
// CHECK-NEXT: Version: 1
// CHECK-NEXT: Augmentation: "zPLR"
// CHECK-NEXT: Code alignment factor: 1
diff --git a/llvm/lib/DebugInfo/DWARF/DWARFDebugFrame.cpp b/llvm/lib/DebugInfo/DWARF/DWARFDebugFrame.cpp
index 675c844726a3..b7d8fb81c54f 100644
--- a/llvm/lib/DebugInfo/DWARF/DWARFDebugFrame.cpp
+++ b/llvm/lib/DebugInfo/DWARF/DWARFDebugFrame.cpp
@@ -287,7 +287,7 @@ void CFIProgram::dump(raw_ostream &OS, const MCRegisterInfo *MRI, bool IsEH,
void CIE::dump(raw_ostream &OS, const MCRegisterInfo *MRI, bool IsEH) const {
OS << format("%08x %08x %08x CIE", (uint32_t)Offset, (uint32_t)Length,
- DW_CIE_ID)
+ IsEH ? 0 : DW_CIE_ID)
<< "\n";
OS << format(" Version: %d\n", Version);
OS << " Augmentation: \"" << Augmentation << "\"\n";
diff --git a/llvm/test/DebugInfo/RISCV/eh-frame.s b/llvm/test/DebugInfo/RISCV/eh-frame.s
index fcff68c09085..f4ea3d55925e 100644
--- a/llvm/test/DebugInfo/RISCV/eh-frame.s
+++ b/llvm/test/DebugInfo/RISCV/eh-frame.s
@@ -8,7 +8,7 @@ func:
ret
.cfi_endproc
-# CHECK: 00000000 00000010 ffffffff CIE
+# CHECK: 00000000 00000010 00000000 CIE
# CHECK: Version: 1
# CHECK: Augmentation: "zR"
# CHECK: Code alignment factor: 1
diff --git a/llvm/test/MC/Mips/eh-frame.s b/llvm/test/MC/Mips/eh-frame.s
index 26e7e1967926..470f43956ccd 100644
--- a/llvm/test/MC/Mips/eh-frame.s
+++ b/llvm/test/MC/Mips/eh-frame.s
@@ -54,7 +54,7 @@ func:
// PIC64-NEXT: R_MIPS_PC32/R_MIPS_NONE/R_MIPS_NONE
// RELOCS-NEXT: }
-// DWARF32: 00000000 00000010 ffffffff CIE
+// DWARF32: 00000000 00000010 00000000 CIE
// DWARF32-NEXT: Version: 1
// DWARF32-NEXT: Augmentation: "zR"
// DWARF32-NEXT: Code alignment factor: 1
@@ -73,7 +73,7 @@ func:
// DWARF32-NEXT: DW_CFA_nop:
-// DWARF64: 00000000 00000010 ffffffff CIE
+// DWARF64: 00000000 00000010 00000000 CIE
// DWARF64-NEXT: Version: 1
// DWARF64-NEXT: Augmentation: "zR"
// DWARF64-NEXT: Code alignment factor: 1
diff --git a/llvm/test/MC/X86/return-column.s b/llvm/test/MC/X86/return-column.s
index 8fade82584dd..eec886ac64f7 100644
--- a/llvm/test/MC/X86/return-column.s
+++ b/llvm/test/MC/X86/return-column.s
@@ -33,11 +33,11 @@ h:
// CHECK-ASM-ROUNDTRIP-NEXT: .cfi_return_column 0
// CHECK-ASM-ROUNDTRIP: .cfi_endproc
-// CHECK-EH_FRAME: 00000000 00000014 ffffffff CIE
+// CHECK-EH_FRAME: 00000000 00000014 00000000 CIE
// CHECK-EH_FRAME: Return address column: 0
-// CHECK-EH_FRAME: 0000002c 00000014 ffffffff CIE
+// CHECK-EH_FRAME: 0000002c 00000014 00000000 CIE
// CHECK-EH_FRAME: Return address column: 65
-// CHECK-EH_FRAME-NOT: ........ 00000014 ffffffff CIE
+// CHECK-EH_FRAME-NOT: ........ 00000014 00000000 CIE
diff --git a/llvm/test/tools/llvm-dwarfdump/X86/eh-frame-return-address-reg.s b/llvm/test/tools/llvm-dwarfdump/X86/eh-frame-return-address-reg.s
index 033766534b6c..12e30cd6229c 100644
--- a/llvm/test/tools/llvm-dwarfdump/X86/eh-frame-return-address-reg.s
+++ b/llvm/test/tools/llvm-dwarfdump/X86/eh-frame-return-address-reg.s
@@ -10,7 +10,7 @@
# checks that we are able to dump it correctly.
# CHECK: .eh_frame contents:
-# CHECK: 00000000 00000010 ffffffff CIE
+# CHECK: 00000000 00000010 00000000 CIE
# CHECK-NEXT: Version: 1
# CHECK-NEXT: Augmentation: "zR"
# CHECK-NEXT: Code alignment factor: 1
diff --git a/llvm/test/tools/llvm-objdump/eh_frame-arm64.test b/llvm/test/tools/llvm-objdump/eh_frame-arm64.test
index f6d2db885221..88269c6fd328 100644
--- a/llvm/test/tools/llvm-objdump/eh_frame-arm64.test
+++ b/llvm/test/tools/llvm-objdump/eh_frame-arm64.test
@@ -2,7 +2,7 @@
# CHECK: .eh_frame contents:
-# CHECK: 00000000 00000010 ffffffff CIE
+# CHECK: 00000000 00000010 00000000 CIE
# CHECK: Version: 1
# CHECK: Augmentation: "zR"
# CHECK: Code alignment factor: 1
diff --git a/llvm/test/tools/llvm-objdump/eh_frame-coff.test b/llvm/test/tools/llvm-objdump/eh_frame-coff.test
index cb481939dcc8..7d4c20eef9ad 100644
--- a/llvm/test/tools/llvm-objdump/eh_frame-coff.test
+++ b/llvm/test/tools/llvm-objdump/eh_frame-coff.test
@@ -2,7 +2,7 @@
# CHECK: .eh_frame contents:
-# CHECK: 00000000 0000001c ffffffff CIE
+# CHECK: 00000000 0000001c 00000000 CIE
# CHECK: Version: 1
# CHECK: Augmentation: "zPLR"
# CHECK: Code alignment factor: 1
diff --git a/llvm/test/tools/llvm-objdump/eh_frame-mipsel.test b/llvm/test/tools/llvm-objdump/eh_frame-mipsel.test
index 0592c8c212e8..4f1b129c16dd 100644
--- a/llvm/test/tools/llvm-objdump/eh_frame-mipsel.test
+++ b/llvm/test/tools/llvm-objdump/eh_frame-mipsel.test
@@ -2,7 +2,7 @@
# CHECK: .eh_frame contents:
-# CHECK: 00000000 00000018 ffffffff CIE
+# CHECK: 00000000 00000018 00000000 CIE
# CHECK: Version: 1
# CHECK: Augmentation: "zPLR"
# CHECK: Code alignment factor: 1
@@ -19,7 +19,7 @@
# CHECK: DW_CFA_offset: reg31 -4
# CHECK: DW_CFA_nop:
-# CHECK: 00000038 00000000 ffffffff CIE
+# CHECK: 00000038 00000000 00000000 CIE
# CHECK: Version: 0
# CHECK: Augmentation: ""
# CHECK: Code alignment factor: 0
diff --git a/llvm/test/tools/llvm-objdump/eh_frame_zero_cie.test b/llvm/test/tools/llvm-objdump/eh_frame_zero_cie.test
index 7b345c9d55a9..652fd0a4e191 100644
--- a/llvm/test/tools/llvm-objdump/eh_frame_zero_cie.test
+++ b/llvm/test/tools/llvm-objdump/eh_frame_zero_cie.test
@@ -2,7 +2,7 @@
# CHECK: .eh_frame contents:
-# CHECK: 00000000 00000000 ffffffff CIE
+# CHECK: 00000000 00000000 00000000 CIE
# CHECK: Version: 0
# CHECK: Augmentation: ""
# CHECK: Code alignment factor: 0
More information about the llvm-commits
mailing list