From 069df3c06ff155f7cffc2511603320e460455c0f Mon Sep 17 00:00:00 2001 From: Johannes Rudolph Date: Thu, 12 Jan 2012 10:53:48 +0100 Subject: fix dvmDbgOutputAllInterfaces to include only direct super-interfaces As the javadoc and the spec say dvmDbgOutputAllInterfaces should output only the directly implemented interfaces. This can be achieved by just iterating over the `clazz->interfaces`. Issue: http://code.google.com/p/android/issues/detail?id=21422 Change-Id: I1779e2cc2ada7afaaf4a1e2e5c7861d61d9ea014 Signed-off-by: Johannes Rudolph --- vm/Debugger.cpp | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/vm/Debugger.cpp b/vm/Debugger.cpp index 5a4e0e5f5..b54facd36 100644 --- a/vm/Debugger.cpp +++ b/vm/Debugger.cpp @@ -1264,20 +1264,15 @@ void dvmDbgOutputAllMethods(RefTypeId refTypeId, bool withGeneric, void dvmDbgOutputAllInterfaces(RefTypeId refTypeId, ExpandBuf* pReply) { ClassObject* clazz; - int i, start, count; + int i, count; clazz = refTypeIdToClassObject(refTypeId); assert(clazz != NULL); - if (clazz->super == NULL) - start = 0; - else - start = clazz->super->iftableCount; - - count = clazz->iftableCount - start; + count = clazz->interfaceCount; expandBufAdd4BE(pReply, count); - for (i = start; i < clazz->iftableCount; i++) { - ClassObject* iface = clazz->iftable[i].clazz; + for (i = 0; i < count; i++) { + ClassObject* iface = clazz->interfaces[i]; expandBufAddRefTypeId(pReply, classObjectToRefTypeId(iface)); } } -- cgit v1.2.3