OSDN Git Service

JDWP: properly combine location events
authorSebastien Hertz <shertz@google.com>
Fri, 10 Apr 2015 10:12:33 +0000 (12:12 +0200)
committerSebastien Hertz <shertz@google.com>
Thu, 7 May 2015 20:20:26 +0000 (22:20 +0200)
commitc3cde2c00bcbe97c9b0c119919500fcbbe824baa
tree0818cd13edb117f5c5f1513aea20c560277768be
parent5260d14566d13b1767ca63d2768d9b0e0a1bba33
JDWP: properly combine location events

This CL properly groups JDWP events at the same location: Breakpoint,
Single-step, Method Entry and Method Exit. This is necessary if the
debugger is not the only instrumentation listener. This matches the
behavior of Dalvik, especially for methods with a single return
instruction.

The interpreter was tuned so the instrumentation callbacks were
called to satisfy the debugger with the idea the debugger was the
only instrumentation listener. This is not true when method tracing
is enabled at the same time.
When tracing is enabled, there is always a listener for MethodEntry
and MethodExit events (art::Trace class). However, if the debugger
is only listening to DexPcMoved event (to manage JDWP Breakpoint
event), it will not be notified of this event.

We now properly call all the instrumentation callbacks in the
interpreter and move the logic specific to debugging into the class
DebugInstrumentationListener. This allows to properly group JDWP
location events together depending on the sequence of instrumentation
callbacks.

We add Thread::tls_32bit_sized_values::debug_method_entry_ flag to
remember we just entered a method. It replaces the local variable
notified_method_entry_event in the interpreter and simplifies the
code.

Bump oat version to force recompilation because the layout of the
Thread class is modified.

Bug: 19829329
Bug: 20205350

(cherry picked from commit 9d6bf69ad3012a9d843268fdd5325b6719b6d5f2)

Change-Id: I204af9112e37d2eebc86661fb7c961a41c74e598
runtime/asm_support.h
runtime/debugger.cc
runtime/debugger.h
runtime/interpreter/interpreter_goto_table_impl.cc
runtime/interpreter/interpreter_switch_impl.cc
runtime/jdwp/jdwp_event.cc
runtime/oat.h
runtime/thread.h