Remove old JDWP implementation from ART

The old 'internal' JDWP implementation hasn't been used for a few
releases and it's a lot of code that's barely being tested and is at
risk of bit-rot. To simplify the runtime and remove potentially buggy
code this removes it.

We also needed to rewrite the DdmThreadNotification code since it
relied on the suspension functionality from the old debugger and was
generally unsafe.

Test: ./test.py --host
Test: atest --test-mapping cts/tests/jdwp/TEST_MAPPING
Test: atest --test-mapping cts/hostsidetests/jdwptunnel/TEST_MAPPING
Test: Manual ddms

Bug: 119034743

Change-Id: I775f310a009141296b730e4a6c2503506a329481
diff --git a/runtime/thread.h b/runtime/thread.h
index 34434cf..483191e 100644
--- a/runtime/thread.h
+++ b/runtime/thread.h
@@ -85,7 +85,6 @@
 class ClassLinker;
 class Closure;
 class Context;
-struct DebugInvokeReq;
 class DeoptimizationContextRecord;
 class DexFile;
 class FrameIdToShadowFrame;
@@ -96,7 +95,6 @@
 class RootVisitor;
 class ScopedObjectAccessAlreadyRunnable;
 class ShadowFrame;
-class SingleStepControl;
 class StackedShadowFrameRecord;
 enum class SuspendReason : char;
 class Thread;
@@ -941,14 +939,6 @@
     return handle_scope;
   }
 
-  DebugInvokeReq* GetInvokeReq() const {
-    return tlsPtr_.debug_invoke_req;
-  }
-
-  SingleStepControl* GetSingleStepControl() const {
-    return tlsPtr_.single_step_control;
-  }
-
   // Indicates whether this thread is ready to invoke a method for debugging. This
   // is only true if the thread has been suspended by a debug event.
   bool IsReadyForDebugInvoke() const {
@@ -1024,25 +1014,6 @@
   // Returns true if the thread is allowed to load java classes.
   bool CanLoadClasses() const;
 
-  // 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();
-
-  // Sets debug invoke request for debugging. When the thread is resumed,
-  // it executes the method described by this request then sends the reply
-  // before suspending itself. The thread takes the ownership of the given
-  // DebugInvokeReq*. It is deleted by a call to ClearDebugInvokeReq.
-  void SetDebugInvokeReq(DebugInvokeReq* req);
-
-  // Clears debug invoke request for debugging. When the thread completes
-  // method invocation, it deletes its debug invoke request and suspends
-  // itself.
-  void ClearDebugInvokeReq();
-
   // Returns the fake exception used to activate deoptimization.
   static mirror::Throwable* GetDeoptimizationException() {
     // Note that the mirror::Throwable must be aligned to kObjectAlignment or else it cannot be
@@ -1389,8 +1360,7 @@
                        jint thread_priority)
       REQUIRES_SHARED(Locks::mutator_lock_);
 
-  // Avoid use, callers should use SetState. Used only by SignalCatcher::HandleSigQuit, ~Thread and
-  // Dbg::ManageDeoptimization.
+  // Avoid use, callers should use SetState. Used only by SignalCatcher::HandleSigQuit and, ~Thread
   ThreadState SetStateUnsafe(ThreadState new_state) {
     ThreadState old_state = GetState();
     if (old_state == kRunnable && new_state != kRunnable) {
@@ -1693,7 +1663,7 @@
       self(nullptr), opeer(nullptr), jpeer(nullptr), stack_begin(nullptr), stack_size(0),
       deps_or_stack_trace_sample(), wait_next(nullptr), monitor_enter_object(nullptr),
       top_handle_scope(nullptr), class_loader_override(nullptr), long_jump_context(nullptr),
-      instrumentation_stack(nullptr), debug_invoke_req(nullptr), single_step_control(nullptr),
+      instrumentation_stack(nullptr),
       stacked_shadow_frame_record(nullptr), deoptimization_context_stack(nullptr),
       frame_id_to_shadow_frame(nullptr), name(nullptr), pthread_self(0),
       last_no_thread_suspension_cause(nullptr), checkpoint_function(nullptr),
@@ -1779,12 +1749,6 @@
     // Stored as a pointer since std::deque is not PACKED.
     std::deque<instrumentation::InstrumentationStackFrame>* instrumentation_stack;
 
-    // JDWP invoke-during-breakpoint support.
-    DebugInvokeReq* debug_invoke_req;
-
-    // JDWP single-stepping support.
-    SingleStepControl* single_step_control;
-
     // For gc purpose, a shadow frame record stack that keeps track of:
     // 1) shadow frames under construction.
     // 2) deoptimization shadow frames.
@@ -1906,7 +1870,6 @@
   // the caller is allowed to access all fields and methods in the Core Platform API.
   uint32_t core_platform_api_cookie_ = 0;
 
-  friend class Dbg;  // For SetStateUnsafe.
   friend class gc::collector::SemiSpace;  // For getting stack traces.
   friend class Runtime;  // For CreatePeer.
   friend class QuickExceptionHandler;  // For dumping the stack.