summaryrefslogtreecommitdiffstats
path: root/vm/Init.h
diff options
context:
space:
mode:
authorElliott Hughes <enh@google.com>2011-06-22 13:24:06 -0700
committerElliott Hughes <enh@google.com>2011-06-28 17:31:46 -0700
commit5719d5c79558ffdbbb863ddcf61836221aba922d (patch)
tree62242b50c2b1692813a05daaa59151aedcc14c8e /vm/Init.h
parent2e31bb77dccb07315ad1a794c064a52633adfa34 (diff)
downloadandroid_dalvik-5719d5c79558ffdbbb863ddcf61836221aba922d.tar.gz
android_dalvik-5719d5c79558ffdbbb863ddcf61836221aba922d.tar.bz2
android_dalvik-5719d5c79558ffdbbb863ddcf61836221aba922d.zip
Improve -verbose:jni.
The old output just told you what functions were being called and made no attempt to show you their arguments. The new output was sufficient to debug an actual problem with an app we don't have the source to. Still to do: 0. an easier way for third-party developers to enable this. 1. the primitive type arguments to SetIntField and so forth. 2. return values. A few examples of the new output... A decoded jclass: JNI: libcore.io.Posix.readBytes called IsInstanceOf((JNIEnv*)0x9618470, 0x28100015, java.lang.Class<byte[]>) A decoded jfieldID: JNI: libcore.io.Posix.ioctlInt called GetIntField((JNIEnv*)0x9618470, 0x5cb00011, java.io.FileDescriptor.descriptor) A decoded jmethodID (the FileDescriptor constructor): JNI: libcore.io.Posix.open called NewObject((JNIEnv*)0x9780480, java.lang.Class<java.io.FileDescriptor>, java.io.FileDescriptor.<init>()V, ...) A const char*: JNI: libcore.io.Posix.getsockoptLinger called NewStringUTF((JNIEnv*)0x9618470, "getsockopt") A jint release mode: JNI: libcore.io.Posix.writeBytes called ReleaseByteArrayElements((JNIEnv*)0x9780480, 0x2700009, (void*) 0xf5f623c4, JNI_ABORT) The -verbose:jni option now turns on a bit more output about JNI_OnLoad calls but no longer causes any logging of calls to JNIEnv or JavaVM functions. The old -Xjnitrace: option has been extended to enable this new tracing for the native methods that it covers. They go very well together for debugging purposes. I've also made us a bit more verbose if we fail to initialize. In the longer term I think we want to just abort if we hit any failure during startup, but my extra logging will save us a bit of time next time we have one of these failures (this one was caused for me by only having one half of the finalizer watchdog change; I was missing the libcore side). (Cherry pick of 6734b8224fb869c94e42e704ec03f2ce8483af2b from dalvik-dev.) Change-Id: I69b7620b20620e9f06576da244520d9d83f89ab8
Diffstat (limited to 'vm/Init.h')
-rw-r--r--vm/Init.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/vm/Init.h b/vm/Init.h
index 5a331a79a..1b585fa19 100644
--- a/vm/Init.h
+++ b/vm/Init.h
@@ -23,8 +23,8 @@
/*
* Standard VM initialization, usually invoked through JNI.
*/
-int dvmStartup(int argc, const char* const argv[], bool ignoreUnrecognized,
- JNIEnv* pEnv);
+std::string dvmStartup(int argc, const char* const argv[],
+ bool ignoreUnrecognized, JNIEnv* pEnv);
void dvmShutdown(void);
bool dvmInitAfterZygote(void);