Move single-step control into thread.
This CL moves single-step control into the Thread structure. This is stored in
Thread::single_step_control_ member. This allows to support single-stepping of
multiple threads at the same time.
Since each thread holds its single-step information, we no longer need to use
the breakpoint lock to support single-stepping. It helps reduce lock contention
on this lock while debugging.
All JDWP tests passed on the host and on the target with this CL.
Bug: 11667502
Change-Id: I886d5c8c625ca5a072803e296c32eec5f7e9e82d
diff --git a/runtime/thread.h b/runtime/thread.h
index 6bd3607..745b1ac 100644
--- a/runtime/thread.h
+++ b/runtime/thread.h
@@ -68,6 +68,7 @@
class ScopedObjectAccess;
class ScopedObjectAccessUnchecked;
class ShadowFrame;
+struct SingleStepControl;
class Thread;
class ThreadList;
@@ -513,6 +514,10 @@
return debug_invoke_req_;
}
+ SingleStepControl* GetSingleStepControl() const {
+ return single_step_control_;
+ }
+
void SetDeoptimizationShadowFrame(ShadowFrame* sf);
void SetDeoptimizationReturnValue(const JValue& ret_val);
@@ -746,6 +751,9 @@
// JDWP invoke-during-breakpoint support.
DebugInvokeReq* debug_invoke_req_;
+ // JDWP single-stepping support.
+ SingleStepControl* single_step_control_;
+
// Shadow frame that is used temporarily during the deoptimization of a method.
ShadowFrame* deoptimization_shadow_frame_;
JValue deoptimization_return_value_;