Revert "Add binary search table for .debug_frame"
(cherry picked from commit d4f8afb4d8bc7bb5cbaf217c2f0734b880b62689)
This reverts commit 5f1465ff689eccbb1b6d15160d1a3700793956da.
Reason for revert: Reclaim space for now as I didn't manage
to implement the libunwindstack side yet.
Bug: 110133331
Test: test.py --host -b -r -t 137-cfi
Change-Id: I4974cc2d49a4bd704d4774028237a8bac6de9053
Merged-In: Iffeed63e54f38a905324d03b148daac4bb37f6cf
diff --git a/compiler/debug/elf_debug_frame_writer.h b/compiler/debug/elf_debug_frame_writer.h
index 44b70ff..31bfed6 100644
--- a/compiler/debug/elf_debug_frame_writer.h
+++ b/compiler/debug/elf_debug_frame_writer.h
@@ -29,6 +29,8 @@
namespace art {
namespace debug {
+static constexpr bool kWriteDebugFrameHdr = false;
+
static void WriteCIE(InstructionSet isa, /*inout*/ std::vector<uint8_t>* buffer) {
using Reg = dwarf::Reg;
// Scratch registers should be marked as undefined. This tells the
@@ -194,7 +196,9 @@
});
std::vector<uint32_t> binary_search_table;
- binary_search_table.reserve(2 * sorted_method_infos.size());
+ if (kWriteDebugFrameHdr) {
+ binary_search_table.reserve(2 * sorted_method_infos.size());
+ }
// Write .debug_frame section.
auto* cfi_section = builder->GetDebugFrame();
@@ -210,8 +214,10 @@
DCHECK(!mi->cfi.empty());
const Elf_Addr code_address = mi->code_address +
(mi->is_code_address_text_relative ? builder->GetText()->GetAddress() : 0);
- binary_search_table.push_back(dchecked_integral_cast<uint32_t>(code_address));
- binary_search_table.push_back(cfi_section->GetPosition());
+ if (kWriteDebugFrameHdr) {
+ binary_search_table.push_back(dchecked_integral_cast<uint32_t>(code_address));
+ binary_search_table.push_back(cfi_section->GetPosition());
+ }
dwarf::WriteFDE(is64bit,
/* cie_pointer= */ 0,
code_address,
@@ -224,7 +230,7 @@
cfi_section->End();
}
- if (method_infos.size() > 1) {
+ if (kWriteDebugFrameHdr) {
std::sort(binary_search_table.begin(), binary_search_table.end());
// Custom Android section. It is very similar to the official .eh_frame_hdr format.