From e3ea83811d47152c00abea24a9b420651a33b496 Mon Sep 17 00:00:00 2001 From: Yevgeny Rouban Date: Fri, 8 Aug 2014 16:29:38 +0700 Subject: ART source line debug info in OAT files OAT files have source line information enough for ART runtime needs like jump to/from interpreter and thread suspension. But this information is not enough for finer grained source level debugging and low-level profiling (VTune or perf). This patch adds to OAT files two additional sections: .debug_line - DWARF formatted Elf32 section with detailed source line information (mapping from native PC to Java source lines). In addition to the debugging symbols added using the dex2oat option --include-debug-symbols, the source line information is added to the section .debug_line. The source line info can be read by many Elf reading tools like objdump, readelf, dwarfdump, gdb, perf, VTune, ... gdb can use this debug line information in x86. In 64-bit mode the information can be used if the oat file is mapped in the lower address space (address has higher 32 bits zeroed). Relocation works. Testing: 1. art/test/run-test --host --gdb [--64] 001-HelloWorld 2. in gdb: break Main.java:19 3. in gdb: break Runtime.java:111 4. in gdb: run - stops at void java.lang.Runtime.() 5. in gdb: backtrace - shows call stack down to main() 6. in gdb: continue - stops at void Main.main() (only in 32-bit mode) 7. in gdb: backtrace - shows call stack down to main() 8. objdump -W - addresses are from VMA range of .text section reported by objdump -h 9. dwarfdump -ka - no errors expected Size of aosp-x86-eng boot.oat increased by 11% from 80.5Mb to 89.2Mb with two sections added .debug_line (7.2Mb) and .rel.debug (1.5Mb). Change-Id: Ib8828832686e49782a63d5529008ff4814ed9cda Signed-off-by: Yevgeny Rouban --- patchoat/patchoat.cc | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'patchoat') diff --git a/patchoat/patchoat.cc b/patchoat/patchoat.cc index eed20da..72ad9a5 100644 --- a/patchoat/patchoat.cc +++ b/patchoat/patchoat.cc @@ -569,6 +569,11 @@ bool PatchOat::PatchElf() { } } + t.NewTiming("Fixup Debug Sections"); + if (!oat_file_->FixupDebugSections(delta_)) { + return false; + } + return true; } -- cgit v1.1