[libbluray-devel] Added JVM debug/trace options.

hpi1 git at videolan.org
Mon Apr 8 11:21:59 CEST 2013


libbluray | branch: master | hpi1 <hpi1 at anonymous.org> | Mon Apr  8 10:57:40 2013 +0300| [790deef0fa4a7f2c7da7eba40dcc74de0da906d9] | committer: hpi1

Added JVM debug/trace options.
Debug/trace can be switched on with environment variables BDJ_JVM_DEBUG and BDJ_JVM_TRACE.

> http://git.videolan.org/gitweb.cgi/libbluray.git/?a=commit;h=790deef0fa4a7f2c7da7eba40dcc74de0da906d9
---

 src/libbluray/bdj/bdj.c |   20 ++++++++++++++++++++
 1 file changed, 20 insertions(+)

diff --git a/src/libbluray/bdj/bdj.c b/src/libbluray/bdj/bdj.c
index 40c542e..2a7b8bf 100644
--- a/src/libbluray/bdj/bdj.c
+++ b/src/libbluray/bdj/bdj.c
@@ -300,6 +300,26 @@ BDJAVA* bdj_open(const char *path, struct bluray *bd,
     option[n++].optionString = str_dup   ("-XfullShutdown");
 #endif
 
+    /* JVM debug options */
+    if (getenv("BDJ_JVM_DEBUG")) {
+        option[n++].optionString = str_dup("-ea");
+        //option[n++].optionString = str_dup("-verbose");
+        //option[n++].optionString = str_dup("-verbose:class,gc,jni");
+        option[n++].optionString = str_dup("-Xdebug");
+        option[n++].optionString = str_dup("-Xrunjdwp:transport=dt_socket,address=8000,server=y,suspend=n");
+    }
+
+#ifdef HAVE_BDJ_J2ME
+    /*
+      see: http://docs.oracle.com/javame/config/cdc/cdc-opt-impl/ojmeec/1.0/runtime/html/cvm.htm#CACBHBJB
+      trace method execution: BDJ_JVM_TRACE=0x0002
+      trace exceptions:       BDJ_JVM_TRACE=0x4000
+    */
+    if (getenv("BDJ_JVM_TRACE")) {
+        option[n++].optionString = str_printf("-Xtrace:%s", getenv("BDJ_JVM_TRACE"));
+    }
+#endif
+
     args.version = JNI_VERSION_1_4;
     args.nOptions = n;
     args.options = option;



More information about the libbluray-devel mailing list