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
diff --git a/runtime/jdwp/jdwp_handler.cc b/runtime/jdwp/jdwp_handler.cc
index df6936b..f1f4a03 100644
--- a/runtime/jdwp/jdwp_handler.cc
+++ b/runtime/jdwp/jdwp_handler.cc
@@ -745,6 +745,15 @@
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 @@
{ 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) */