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>
Wed, 29 Apr 2015 14:59:58 +0000 (16:59 +0200)
commit9d6bf69ad3012a9d843268fdd5325b6719b6d5f2
treea41fc22d2c89e41c86feb5ef07ebda89b1b83d90
parentb6829c2ee05124d64a19c7a52ada4a23f624fb91
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
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