summaryrefslogtreecommitdiffstats
path: root/patchoat
diff options
context:
space:
mode:
authorYevgeny Rouban <yevgeny.y.rouban@intel.com>2014-08-08 16:29:38 +0700
committerTong Shen <endlessroad@google.com>2014-08-15 15:04:12 -0700
commite3ea83811d47152c00abea24a9b420651a33b496 (patch)
treedd3b8018176ada85d51b2f8ca46e515fbf55b50f /patchoat
parent9dcf75c80187504ec88e7ef91d64a6a68279eb9d (diff)
downloadart-e3ea83811d47152c00abea24a9b420651a33b496.zip
art-e3ea83811d47152c00abea24a9b420651a33b496.tar.gz
art-e3ea83811d47152c00abea24a9b420651a33b496.tar.bz2
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.<init>() 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 <oat-file> - addresses are from VMA range of .text section reported by objdump -h <file> 9. dwarfdump -ka <oat-file> - 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 <yevgeny.y.rouban@intel.com>
Diffstat (limited to 'patchoat')
-rw-r--r--patchoat/patchoat.cc5
1 files changed, 5 insertions, 0 deletions
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;
}