Fix a couple of JDWP bugs.
A couple of JDWP tests started failing when we made "thread suspend
count is already zero" into a fatal error. This patch makes the debugger
a bit more careful about doing silly things (the JDWP protocol defines
these silly things as no-ops, and it's surprisingly easy for an end
user to get us into this state; just sit typing "resume" at the jdb(1)
prompt, for example).
I've also tidied up GetObjectTag to return an error on failure, but
that isn't the fix to any bug the tests find. (The only remaining JDWP
bugs are all caused by an inability to cope with register promotion,
and we're already working on the proper fix for that.)
Change-Id: I671f62234b5cb41aa9d86c6b947c518d7c068800
diff --git a/src/debugger.h b/src/debugger.h
index 89aac8e..9dffa7c 100644
--- a/src/debugger.h
+++ b/src/debugger.h
@@ -141,7 +141,7 @@
static JDWP::JdwpError GetReferenceType(JDWP::ObjectId objectId, JDWP::ExpandBuf* pReply);
static JDWP::JdwpError GetSignature(JDWP::RefTypeId refTypeId, std::string& signature);
static JDWP::JdwpError GetSourceFile(JDWP::RefTypeId refTypeId, std::string& source_file);
- static uint8_t GetObjectTag(JDWP::ObjectId objectId);
+ static JDWP::JdwpError GetObjectTag(JDWP::ObjectId objectId, uint8_t& tag);
static size_t GetTagWidth(JDWP::JdwpTag tag);
static JDWP::JdwpError GetArrayLength(JDWP::ObjectId arrayId, int& length);