From ad5fa8c5b26a325dc2a9521b87188755046c17f3 Mon Sep 17 00:00:00 2001 From: David Srbecky Date: Wed, 6 May 2015 18:27:35 +0100 Subject: Support generation of CFI in .debug_frame format. .debug_frame section is almost identical to .eh_frame section. There are only minor differences in the CIE and FDE headers. The main difference is that .eh_frame is intended to be used at runtime for exception handling and is therefore allocated within the running program whereas .debug_frame is not. This makes .debug_frame easier to remove using standard tools. "objcopy --strip-debug" removes .debug_frame, but not .eh_frame. (although objcopy can be still be forced to remove .eh_frame) Similarly, we might want to separate the CFI to separate debug file or include it as compressed .gnu_debugdata section. It is more appropriate to use .debug_frame for this purpose. Bug:20556771 Change-Id: I9d91a333b9fb37523fd6fafccfad89b21d2477af --- compiler/dwarf/dwarf_test.h | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'compiler/dwarf/dwarf_test.h') diff --git a/compiler/dwarf/dwarf_test.h b/compiler/dwarf/dwarf_test.h index 230ebe3a79..3afb5eae56 100644 --- a/compiler/dwarf/dwarf_test.h +++ b/compiler/dwarf/dwarf_test.h @@ -69,7 +69,7 @@ class DwarfTest : public CommonRuntimeTest { RawSection debug_abbrev(".debug_abbrev", SHT_PROGBITS, 0, nullptr, 0, 1, 0); RawSection debug_str(".debug_str", SHT_PROGBITS, 0, nullptr, 0, 1, 0); RawSection debug_line(".debug_line", SHT_PROGBITS, 0, nullptr, 0, 1, 0); - RawSection eh_frame(".eh_frame", SHT_PROGBITS, SHF_ALLOC, nullptr, 0, kPageSize, 0); + RawSection debug_frame(".debug_frame", SHT_PROGBITS, 0, nullptr, 0, 8, 0); if (!debug_info_data_.empty()) { debug_info.SetBuffer(debug_info_data_); builder.RegisterSection(&debug_info); @@ -86,9 +86,9 @@ class DwarfTest : public CommonRuntimeTest { debug_line.SetBuffer(debug_line_data_); builder.RegisterSection(&debug_line); } - if (!eh_frame_data_.empty()) { - eh_frame.SetBuffer(eh_frame_data_); - builder.RegisterSection(&eh_frame); + if (!debug_frame_data_.empty()) { + debug_frame.SetBuffer(debug_frame_data_); + builder.RegisterSection(&debug_frame); } ScratchFile file; builder.Write(file.GetFile()); @@ -167,7 +167,7 @@ class DwarfTest : public CommonRuntimeTest { } // Buffers which are going to assembled into ELF file and passed to objdump. - std::vector eh_frame_data_; + std::vector debug_frame_data_; std::vector debug_info_data_; std::vector debug_abbrev_data_; std::vector debug_str_data_; -- cgit v1.2.3-59-g8ed1b