summaryrefslogtreecommitdiffstats
path: root/runtime/debugger.h
diff options
context:
space:
mode:
authorSebastien Hertz <shertz@google.com>2015-04-10 12:12:33 +0200
committerSebastien Hertz <shertz@google.com>2015-05-07 22:20:26 +0200
commitc3cde2c00bcbe97c9b0c119919500fcbbe824baa (patch)
tree0818cd13edb117f5c5f1513aea20c560277768be /runtime/debugger.h
parent5260d14566d13b1767ca63d2768d9b0e0a1bba33 (diff)
downloadart-c3cde2c00bcbe97c9b0c119919500fcbbe824baa.zip
art-c3cde2c00bcbe97c9b0c119919500fcbbe824baa.tar.gz
art-c3cde2c00bcbe97c9b0c119919500fcbbe824baa.tar.bz2
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
Diffstat (limited to 'runtime/debugger.h')
-rw-r--r--runtime/debugger.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/runtime/debugger.h b/runtime/debugger.h
index fe90eb6..789a0a4 100644
--- a/runtime/debugger.h
+++ b/runtime/debugger.h
@@ -714,6 +714,10 @@ class Dbg {
static JDWP::JdwpState* GetJdwpState();
+ static uint32_t GetInstrumentationEvents() SHARED_LOCKS_REQUIRED(Locks::mutator_lock_) {
+ return instrumentation_events_;
+ }
+
private:
static JDWP::JdwpError GetLocalValue(const StackVisitor& visitor,
ScopedObjectAccessUnchecked& soa, int slot,