diff options
| author | 2016-02-24 16:35:59 -0800 | |
|---|---|---|
| committer | 2016-02-25 09:41:30 -0800 | |
| commit | 4a28e1e4e02aa44aa6fd20e22d50f9d73f6279cc (patch) | |
| tree | a80ef1c63ed7340cdbcb1f802e0cb26f00d2317f /runtime/jdwp/jdwp_handler.cc | |
| parent | 8ff01690eb2796604b8927076fdde7452b4c8a60 (diff) | |
Support new JDWP InterfaceType.InvokeMethod command
This command is used to invoke static methods in interfaces.
Bug: 27218415
Change-Id: Ie4dc1876a20567240267f309dc18f1aec2c1b4c2
Diffstat (limited to 'runtime/jdwp/jdwp_handler.cc')
| -rw-r--r-- | runtime/jdwp/jdwp_handler.cc | 16 |
1 files changed, 16 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; } |