Fix JDWP stack frame regressions.

The bug was that Dbg::GetThisObject didn't take a thread argument, so
always used the calling thread, which is never the thread whose frames
you actually care about.

I've also made the JDWP ThreadReference.Frames get all the frames at once
now, since we no longer have fast random access to individual frames.

Change-Id: I0ce2bd2088e11d5ea14f9785d7ca0e3890b3cb9b
diff --git a/src/jdwp/jdwp_expand_buf.cc b/src/jdwp/jdwp_expand_buf.cc
index 523c9d7..663afac 100644
--- a/src/jdwp/jdwp_expand_buf.cc
+++ b/src/jdwp/jdwp_expand_buf.cc
@@ -18,6 +18,7 @@
  * primitive values, e.g. JDWP replies.
  */
 
+#include "jdwp/jdwp.h"
 #include "jdwp/jdwp_bits.h"
 #include "jdwp/jdwp_expand_buf.h"
 #include "logging.h"
@@ -174,6 +175,13 @@
   pBuf->curLen += sizeof(uint32_t) + s.size();
 }
 
+void expandBufAddLocation(ExpandBuf* buf, const JdwpLocation& location) {
+  expandBufAdd1(buf, location.type_tag);
+  expandBufAddObjectId(buf, location.class_id);
+  expandBufAddMethodId(buf, location.method_id);
+  expandBufAdd8BE(buf, location.dex_pc);
+}
+
 }  // namespace JDWP
 
 }  // namespace art