Add a JDWP::Request type to replace the old uint8_t* and int.

This also lets us check that all the data in a (successful) request
is actually read, though doing so caught two bugs in the tests, and
may well catch bugs in the actual debuggers.

Change-Id: Ibed402e6f1c0c7a1d19d61f0be9bddd0c2f5a388
diff --git a/src/debugger.h b/src/debugger.h
index d63e44b..321bcf1 100644
--- a/src/debugger.h
+++ b/src/debugger.h
@@ -161,7 +161,7 @@
                                      JDWP::ExpandBuf* pReply)
       SHARED_LOCKS_REQUIRED(Locks::mutator_lock_);
   static JDWP::JdwpError SetArrayElements(JDWP::ObjectId array_id, int offset, int count,
-                                          const uint8_t* buf)
+                                          JDWP::Request& request)
       SHARED_LOCKS_REQUIRED(Locks::mutator_lock_);
 
   static JDWP::ObjectId CreateString(const std::string& str)
@@ -371,7 +371,7 @@
   static void DdmSendThreadNotification(Thread* t, uint32_t type)
       SHARED_LOCKS_REQUIRED(Locks::mutator_lock_);
   static void DdmSetThreadNotification(bool enable);
-  static bool DdmHandlePacket(const uint8_t* buf, int dataLen, uint8_t** pReplyBuf, int* pReplyLen);
+  static bool DdmHandlePacket(JDWP::Request& request, uint8_t** pReplyBuf, int* pReplyLen);
   static void DdmConnected() SHARED_LOCKS_REQUIRED(Locks::mutator_lock_);
   static void DdmDisconnected() SHARED_LOCKS_REQUIRED(Locks::mutator_lock_);
   static void DdmSendChunk(uint32_t type, const std::vector<uint8_t>& bytes)