diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2017-02-24 17:00:28 +0100 |
---|---|---|
committer | Andras Timar <andras.timar@collabora.com> | 2017-03-01 13:46:48 +0100 |
commit | bd4fd4da2fa4c4092c0994cf4891cde953c282af (patch) | |
tree | 544eb4a9e538f0783757ff8568ac566f5c905361 | |
parent | f92bbd767d17e3c322a551ffd221e0810b69c311 (diff) |
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
(cherry picked from commit f21994e7a240563283b7a17dcb435ce7c5156b60)
Reviewed-on: https://gerrit.libreoffice.org/34676
Reviewed-by: Michael Stahl <mstahl@redhat.com>
Tested-by: Jenkins <ci@libreoffice.org>
(cherry picked from commit 90c7d328f3fca95f140affb5dd83622ae3b988c9)
-rw-r--r-- | jvmfwk/plugins/sunmajor/pluginlib/sunjavaplugin.cxx | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/jvmfwk/plugins/sunmajor/pluginlib/sunjavaplugin.cxx b/jvmfwk/plugins/sunmajor/pluginlib/sunjavaplugin.cxx index 5053fdacc0af..63791bceac16 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); |