From 91b290038cbd00a48028922a5e76c0c39d6ebcb6 Mon Sep 17 00:00:00 2001 From: David Srbecky Date: Fri, 8 Feb 2019 15:51:31 +0000 Subject: Remove support for generating .eh_frame ELF section. The eh_frame support was originally added because the old libunwind library didn't support debug_frame. The new libunwind supports debug_frame well, and since we have switched to it, we can remove the legacy code. The main advantage of debug_frame is that it can be compressed as part of mini-debug-info. I am somewhat preserving the .eh_frame_hdr binary search table (renamed as .debug_frame_hdr.android). Bug: 123621350 Test: Generated framework oat files are identical. Change-Id: I35b18895482f2176e02df07b086af7a1d40f90d5 --- compiler/debug/dwarf/dwarf_test.cc | 42 +++++++++++++++++++++++++------------- 1 file changed, 28 insertions(+), 14 deletions(-) (limited to 'compiler/debug/dwarf/dwarf_test.cc') diff --git a/compiler/debug/dwarf/dwarf_test.cc b/compiler/debug/dwarf/dwarf_test.cc index 6512314ae8..52717c352d 100644 --- a/compiler/debug/dwarf/dwarf_test.cc +++ b/compiler/debug/dwarf/dwarf_test.cc @@ -29,8 +29,6 @@ namespace dwarf { // Run the tests only on host since we need objdump. #ifndef ART_TARGET_ANDROID -constexpr CFIFormat kCFIFormat = DW_DEBUG_FRAME_FORMAT; - TEST_F(DwarfTest, DebugFrame) { const bool is64bit = false; @@ -122,12 +120,18 @@ TEST_F(DwarfTest, DebugFrame) { DW_CHECK_NEXT("DW_CFA_restore: r5 (ebp)"); DebugFrameOpCodeWriter<> initial_opcodes; - WriteCIE(is64bit, Reg(is64bit ? 16 : 8), - initial_opcodes, kCFIFormat, &debug_frame_data_); + WriteCIE(is64bit, Reg(is64bit ? 16 : 8), initial_opcodes, &debug_frame_data_); std::vector debug_frame_patches; std::vector expected_patches = { 28 }; - WriteFDE(is64bit, 0, 0, 0x01000000, 0x01000000, ArrayRef(*opcodes.data()), - kCFIFormat, 0, &debug_frame_data_, &debug_frame_patches); + WriteFDE(is64bit, + 0, + 0, + 0x01000000, + 0x01000000, + ArrayRef(*opcodes.data()), + 0, + &debug_frame_data_, + &debug_frame_patches); EXPECT_EQ(expected_patches, debug_frame_patches); CheckObjdumpOutput(is64bit, "-W"); @@ -136,14 +140,19 @@ TEST_F(DwarfTest, DebugFrame) { TEST_F(DwarfTest, DebugFrame64) { constexpr bool is64bit = true; DebugFrameOpCodeWriter<> initial_opcodes; - WriteCIE(is64bit, Reg(16), - initial_opcodes, kCFIFormat, &debug_frame_data_); + WriteCIE(is64bit, Reg(16), initial_opcodes, &debug_frame_data_); DebugFrameOpCodeWriter<> opcodes; std::vector debug_frame_patches; std::vector expected_patches = { 32 }; - WriteFDE(is64bit, 0, 0, 0x0100000000000000, 0x0200000000000000, + WriteFDE(is64bit, + 0, + 0, + 0x0100000000000000, + 0x0200000000000000, ArrayRef(*opcodes.data()), - kCFIFormat, 0, &debug_frame_data_, &debug_frame_patches); + 0, + &debug_frame_data_, + &debug_frame_patches); DW_CHECK("FDE cie=00000000 pc=100000000000000..300000000000000"); EXPECT_EQ(expected_patches, debug_frame_patches); @@ -176,12 +185,17 @@ TEST_F(DwarfTest, x86_64_RegisterMapping) { DW_CHECK_NEXT("DW_CFA_offset: r14 (r14)"); DW_CHECK_NEXT("DW_CFA_offset: r15 (r15)"); DebugFrameOpCodeWriter<> initial_opcodes; - WriteCIE(is64bit, Reg(16), - initial_opcodes, kCFIFormat, &debug_frame_data_); + WriteCIE(is64bit, Reg(16), initial_opcodes, &debug_frame_data_); std::vector debug_frame_patches; - WriteFDE(is64bit, 0, 0, 0x0100000000000000, 0x0200000000000000, + WriteFDE(is64bit, + 0, + 0, + 0x0100000000000000, + 0x0200000000000000, ArrayRef(*opcodes.data()), - kCFIFormat, 0, &debug_frame_data_, &debug_frame_patches); + 0, + &debug_frame_data_, + &debug_frame_patches); CheckObjdumpOutput(is64bit, "-W"); } -- cgit v1.2.3-59-g8ed1b