[Libreoffice-commits] core.git: jvmfwk/plugins
Stephan Bergmann
sbergman at redhat.com
Fri Feb 24 16:02:38 UTC 2017
jvmfwk/plugins/sunmajor/pluginlib/sunjavaplugin.cxx | 10 ++++++++++
1 file changed, 10 insertions(+)
New commits:
commit f21994e7a240563283b7a17dcb435ce7c5156b60
Author: Stephan Bergmann <sbergman at redhat.com>
Date: Fri Feb 24 17:00:28 2017 +0100
Make JVM -Xrunjdwp option work on macOS
I hope loading the jvm library as SAL_LOADMODULE_GLOBAL has no negative
consequences (at least, there is prior art in the LINUX case already).
Change-Id: If18b65bd96f7205fdf9fd41389e64e786c15af16
diff --git a/jvmfwk/plugins/sunmajor/pluginlib/sunjavaplugin.cxx b/jvmfwk/plugins/sunmajor/pluginlib/sunjavaplugin.cxx
index 5053fda..63791bc 100644
--- a/jvmfwk/plugins/sunmajor/pluginlib/sunjavaplugin.cxx
+++ b/jvmfwk/plugins/sunmajor/pluginlib/sunjavaplugin.cxx
@@ -670,6 +670,16 @@ javaPluginError jfw_plugin_startJavaVirtualMachine(
osl::Module moduleRt;
#if defined(LINUX)
if (!moduleRt.load(sRuntimeLib, SAL_LOADMODULE_GLOBAL | SAL_LOADMODULE_NOW))
+#elif defined MACOSX
+ // Must be SAL_LOADMODULE_GLOBAL when e.g. specifying a
+ // -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=8000 option to
+ // JDK 1.8.0_121 at least, as JNI_CreateJavaVM -> Threads::create_vm ->
+ // JvmtiExport::post_vm_initialized -> cbEarlyVMInit -> initialize ->
+ // util_initialize -> sun.misc.VMSupport.getAgentProperties ->
+ // Java_sun_misc_VMSupport_initAgentProperties ->
+ // JDK_FindJvmEntry("JVM_INitAgentProperties") ->
+ // dlsym(RTLD_DEFAULT, "JVM_INitAgentProperties"):
+ if (!moduleRt.load(sRuntimeLib, SAL_LOADMODULE_GLOBAL))
#else
#if defined(_WIN32)
do_msvcr_magic(sRuntimeLib.pData);
More information about the Libreoffice-commits
mailing list