From 2a7c1ef95c850abae915b3a59fbafa87e6833967 Mon Sep 17 00:00:00 2001 From: Yevgeny Rouban Date: Wed, 22 Jul 2015 18:36:24 +0600 Subject: Add more dwarf debug line info for Optimized methods. Optimizing compiler generates minimum debug line info that is built using the dex_pc information about suspend points. This is not enough for performance and debugging needs. This CL generates additional debug line information for instructions which have known dex_pc and it ensures that whole call sites are mapped (as opposed to suspend points which map only one instruction past the function call). Bug: 23157336 Change-Id: I9f2b1c2038e3560847c175b8121cf9496b8b58fa Signed-off-by: Yevgeny Rouban --- compiler/optimizing/code_generator.h | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'compiler/optimizing/code_generator.h') diff --git a/compiler/optimizing/code_generator.h b/compiler/optimizing/code_generator.h index 754b5ecd0e..b3c4d727e0 100644 --- a/compiler/optimizing/code_generator.h +++ b/compiler/optimizing/code_generator.h @@ -229,7 +229,11 @@ class CodeGenerator { return (fpu_callee_save_mask_ & (1 << reg)) != 0; } + // Record native to dex mapping for a suspend point. Required by runtime. void RecordPcInfo(HInstruction* instruction, uint32_t dex_pc, SlowPathCode* slow_path = nullptr); + // Record additional native to dex mappings for native debugging/profiling tools. + void RecordNativeDebugInfo(uint32_t dex_pc, uintptr_t native_pc_begin, uintptr_t native_pc_end); + bool CanMoveNullCheckToUser(HNullCheck* null_check); void MaybeRecordImplicitNullCheck(HInstruction* instruction); @@ -237,7 +241,8 @@ class CodeGenerator { slow_paths_.Add(slow_path); } - void BuildSourceMap(DefaultSrcMap* src_map) const; + void SetSrcMap(DefaultSrcMap* src_map) { src_map_ = src_map; } + void BuildMappingTable(ArenaVector* vector) const; void BuildVMapTable(ArenaVector* vector) const; void BuildNativeGCMap( @@ -395,6 +400,7 @@ class CodeGenerator { disasm_info_(nullptr), graph_(graph), compiler_options_(compiler_options), + src_map_(nullptr), slow_paths_(graph->GetArena(), 8), current_block_index_(0), is_leaf_(true), @@ -489,6 +495,8 @@ class CodeGenerator { HGraph* const graph_; const CompilerOptions& compiler_options_; + // Native to dex_pc map used for native debugging/profiling tools. + DefaultSrcMap* src_map_; GrowableArray slow_paths_; // The current block index in `block_order_` of the block -- cgit v1.2.3-59-g8ed1b