JDWP: allocate single step control only when active
Only allocates SingleStepControl when a single step is requested in
a thread.
Bug: 19142632
Change-Id: I830b7eaea86b516d3fac80ce14d41c66b4bd5415
diff --git a/runtime/thread.h b/runtime/thread.h
index 7db9ba5..c27569e 100644
--- a/runtime/thread.h
+++ b/runtime/thread.h
@@ -75,7 +75,7 @@
class Runtime;
class ScopedObjectAccessAlreadyRunnable;
class ShadowFrame;
-struct SingleStepControl;
+class SingleStepControl;
class Thread;
class ThreadList;
@@ -709,6 +709,15 @@
return tlsPtr_.single_step_control;
}
+ // Activates single step control for debugging. The thread takes the
+ // ownership of the given SingleStepControl*. It is deleted by a call
+ // to DeactivateSingleStepControl or upon thread destruction.
+ void ActivateSingleStepControl(SingleStepControl* ssc);
+
+ // Deactivates single step control for debugging.
+ void DeactivateSingleStepControl();
+
+
// Returns the fake exception used to activate deoptimization.
static mirror::Throwable* GetDeoptimizationException() {
return reinterpret_cast<mirror::Throwable*>(-1);