From 0a97fc6613d525370d9300819a3579f706d6fc67 Mon Sep 17 00:00:00 2001 From: Sebastien Hertz Date: Mon, 9 Nov 2015 12:18:06 +0100 Subject: [PATCH] JDWP: default implementation of Method.IsObsolete To please some IDEs sending this command, adds a default implementation that a method is never obsolete. Bug: 25552174 Bug: https://code.google.com/p/android/issues/detail?id=192784 Change-Id: I328522e6313f2ef5474897cad15a95edd33cd15c --- runtime/jdwp/jdwp_handler.cc | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/runtime/jdwp/jdwp_handler.cc b/runtime/jdwp/jdwp_handler.cc index df6936bf0..f1f4a0386 100644 --- a/runtime/jdwp/jdwp_handler.cc +++ b/runtime/jdwp/jdwp_handler.cc @@ -745,6 +745,15 @@ static JdwpError M_Bytecodes(JdwpState*, Request* request, ExpandBuf* reply) return ERR_NONE; } +// Default implementation for IDEs relying on this command. +static JdwpError M_IsObsolete(JdwpState*, Request* request, ExpandBuf* reply) + SHARED_REQUIRES(Locks::mutator_lock_) { + request->ReadRefTypeId(); // unused reference type ID + request->ReadMethodId(); // unused method ID + expandBufAdd1(reply, false); // a method is never obsolete. + return ERR_NONE; +} + /* * Given an object reference, return the runtime type of the object * (class or array). @@ -1477,7 +1486,7 @@ static const JdwpHandlerMap gHandlers[] = { { 6, 1, M_LineTable, "Method.LineTable" }, { 6, 2, M_VariableTable, "Method.VariableTable" }, { 6, 3, M_Bytecodes, "Method.Bytecodes" }, - { 6, 4, nullptr, "Method.IsObsolete" }, + { 6, 4, M_IsObsolete, "Method.IsObsolete" }, { 6, 5, M_VariableTableWithGeneric, "Method.VariableTableWithGeneric" }, /* Field command set (8) */ -- 2.11.0