diff options
| author | David Srbecky <dsrbecky@google.com> | 2016-03-07 16:13:58 +0000 |
|---|---|---|
| committer | David Srbecky <dsrbecky@google.com> | 2016-03-08 15:48:02 +0000 |
| commit | 91cc06c1814bd1d0fd6635bc3d7632a2bb7b0e7c (patch) | |
| tree | 7c57374bd28d245fd0f071ec66d9aad8501a878a /compiler/debug/elf_debug_line_writer.h | |
| parent | 5d8112029d0e085c5a0099257daa4c7e29c12310 (diff) | |
| download | art-91cc06c1814bd1d0fd6635bc3d7632a2bb7b0e7c.tar.gz art-91cc06c1814bd1d0fd6635bc3d7632a2bb7b0e7c.tar.bz2 art-91cc06c1814bd1d0fd6635bc3d7632a2bb7b0e7c.zip | |
Mark DWARF lines in non-debuggable methods as "not a statement".
This is a hint to the debugger that breakpoints and stepping
might not function as intended (since we have limited information).
Change-Id: I23c4a816182cc7548fcd69fbd00112225e7b1710
Diffstat (limited to 'compiler/debug/elf_debug_line_writer.h')
| -rw-r--r-- | compiler/debug/elf_debug_line_writer.h | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/compiler/debug/elf_debug_line_writer.h b/compiler/debug/elf_debug_line_writer.h index d3859ca752..11be4e9844 100644 --- a/compiler/debug/elf_debug_line_writer.h +++ b/compiler/debug/elf_debug_line_writer.h @@ -184,6 +184,10 @@ class ElfDebugLineWriter { // Generate mapping opcodes from PC to Java lines. if (file_index != 0) { + // If the method was not compiled as native-debuggable, we still generate all available + // lines, but we try to prevent the debugger from stepping and setting breakpoints since + // the information is too inaccurate for that (breakpoints would be set after the calls). + const bool default_is_stmt = mi->is_native_debuggable; bool first = true; for (SrcMapElem pc2dex : pc2dex_map) { uint32_t pc = pc2dex.from_; @@ -205,13 +209,14 @@ class ElfDebugLineWriter { // Assume that any preceding code is prologue. int first_line = dex2line_map.front().line_; // Prologue is not a sensible place for a breakpoint. - opcodes.NegateStmt(); + opcodes.SetIsStmt(false); opcodes.AddRow(method_address, first_line); - opcodes.NegateStmt(); opcodes.SetPrologueEnd(); } + opcodes.SetIsStmt(default_is_stmt); opcodes.AddRow(method_address + pc, line); } else if (line != opcodes.CurrentLine()) { + opcodes.SetIsStmt(default_is_stmt); opcodes.AddRow(method_address + pc, line); } } |
