diff options
| -rw-r--r-- | runtime/jdwp/jdwp_handler.cc | 16 | ||||
| -rw-r--r-- | runtime/jdwp/jdwp_priv.h | 2 |
2 files changed, 18 insertions, 0 deletions
diff --git a/runtime/jdwp/jdwp_handler.cc b/runtime/jdwp/jdwp_handler.cc index f1f4a03861..6278ef09de 100644 --- a/runtime/jdwp/jdwp_handler.cc +++ b/runtime/jdwp/jdwp_handler.cc @@ -690,6 +690,19 @@ static JdwpError AT_newInstance(JdwpState*, Request* request, ExpandBuf* pReply) } /* + * Invoke a static method on an interface. + */ +static JdwpError IT_InvokeMethod(JdwpState* state, Request* request, + ExpandBuf* pReply ATTRIBUTE_UNUSED) + SHARED_REQUIRES(Locks::mutator_lock_) { + RefTypeId class_id = request->ReadRefTypeId(); + ObjectId thread_id = request->ReadThreadId(); + MethodId method_id = request->ReadMethodId(); + + return RequestInvoke(state, request, thread_id, 0, class_id, method_id, false); +} + +/* * Return line number information for the method, if present. */ static JdwpError M_LineTable(JdwpState*, Request* request, ExpandBuf* pReply) @@ -1481,6 +1494,7 @@ static const JdwpHandlerMap gHandlers[] = { { 4, 1, AT_newInstance, "ArrayType.NewInstance" }, /* InterfaceType command set (5) */ + { 5, 1, IT_InvokeMethod, "InterfaceType.InvokeMethod" }, /* Method command set (6) */ { 6, 1, M_LineTable, "Method.LineTable" }, @@ -1579,6 +1593,8 @@ static bool IsInvokeCommand(uint8_t command_set, uint8_t command) { return command == kJDWPClassTypeInvokeMethodCmd || command == kJDWPClassTypeNewInstanceCmd; } else if (command_set == kJDWPObjectReferenceCmdSet) { return command == kJDWPObjectReferenceInvokeCmd; + } else if (command_set == kJDWPInterfaceTypeCmdSet) { + return command == kJDWPInterfaceTypeInvokeMethodCmd; } else { return false; } diff --git a/runtime/jdwp/jdwp_priv.h b/runtime/jdwp/jdwp_priv.h index 29314f6274..4e1bda899f 100644 --- a/runtime/jdwp/jdwp_priv.h +++ b/runtime/jdwp/jdwp_priv.h @@ -45,6 +45,8 @@ static constexpr size_t kMagicHandshakeLen = sizeof(kMagicHandshake) - 1; static constexpr uint8_t kJDWPClassTypeCmdSet = 3U; static constexpr uint8_t kJDWPClassTypeInvokeMethodCmd = 3U; static constexpr uint8_t kJDWPClassTypeNewInstanceCmd = 4U; +static constexpr uint8_t kJDWPInterfaceTypeCmdSet = 5U; +static constexpr uint8_t kJDWPInterfaceTypeInvokeMethodCmd = 1U; static constexpr uint8_t kJDWPObjectReferenceCmdSet = 9U; static constexpr uint8_t kJDWPObjectReferenceInvokeCmd = 6U; |