Use dvmHumanReadableDescriptor in -Xjnitrace.
This made the output more readable while debugging a zlib issue.
Bug: 3220923
Change-Id: Ie360516a8a7a92b5b75fe70feb5c9722289bed78
diff --git a/vm/Native.c b/vm/Native.c
index 1ebef2e..8436e7f 100644
--- a/vm/Native.c
+++ b/vm/Native.c
@@ -848,27 +848,34 @@
*desc != '\0');
}
+ char* className = dvmHumanReadableDescriptor(method->clazz->descriptor);
char* signature = dexProtoCopyMethodDescriptor(&method->prototype);
- LOGI_NATIVE("-> %s.%s%s %s(%s)", method->clazz->descriptor, method->name,
- signature, thisString, argsString);
+ LOGI_NATIVE("-> %s %s%s %s(%s)", className, method->name, signature,
+ thisString, argsString);
+ free(className);
free(signature);
}
void dvmLogNativeMethodExit(const Method* method, Thread* self,
const JValue returnValue)
{
+ char* className = dvmHumanReadableDescriptor(method->clazz->descriptor);
char* signature = dexProtoCopyMethodDescriptor(&method->prototype);
if (dvmCheckException(self)) {
Object* exception = dvmGetException(self);
- LOGI_NATIVE("<- %s.%s%s threw %s", method->clazz->descriptor,
- method->name, signature, exception->clazz->descriptor);
+ char* exceptionClassName =
+ dvmHumanReadableDescriptor(exception->clazz->descriptor);
+ LOGI_NATIVE("<- %s %s%s threw %s", className,
+ method->name, signature, exceptionClassName);
+ free(exceptionClassName);
} else {
char returnValueString[128] = { 0 };
char returnType = method->shorty[0];
appendValue(returnType, returnValue,
- returnValueString, sizeof(returnValueString), false);
- LOGI_NATIVE("<- %s.%s%s returned %s", method->clazz->descriptor,
- method->name, signature, returnValueString);
+ returnValueString, sizeof(returnValueString), false);
+ LOGI_NATIVE("<- %s %s%s returned %s", className,
+ method->name, signature, returnValueString);
}
+ free(className);
free(signature);
}