From 327826f2c9468dee733bbb9cc5211065679cfe46 Mon Sep 17 00:00:00 2001 From: Maksim Belov <45949002+artdeell@users.noreply.github.com> Date: Sun, 21 Jan 2024 20:54:14 +0300 Subject: [PATCH] Print which code path is used for library iteration --- .../lwjgl/core/src/main/c/org_lwjgl_system_SharedLibraryUtil.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/modules/lwjgl/core/src/main/c/org_lwjgl_system_SharedLibraryUtil.c b/modules/lwjgl/core/src/main/c/org_lwjgl_system_SharedLibraryUtil.c index e387b87314..499f464b5d 100644 --- a/modules/lwjgl/core/src/main/c/org_lwjgl_system_SharedLibraryUtil.c +++ b/modules/lwjgl/core/src/main/c/org_lwjgl_system_SharedLibraryUtil.c @@ -167,6 +167,7 @@ EXTERN_C_ENTER JNIEXPORT int JNICALL Java_org_lwjgl_system_SharedLibraryUtil_getLibraryPath(JNIEnv *env, jclass clazz, jlong pLibAddress, jlong sOutAddress, int bufSize) { + printf("LWJGL: Using dlinfo() code path\n"); UNUSED_PARAMS(env, clazz) void *pLib = (void *)(uintptr_t)pLibAddress; char *sOut = (char *)(uintptr_t)sOutAddress; @@ -296,6 +297,7 @@ EXTERN_C_ENTER JNIEXPORT int JNICALL Java_org_lwjgl_system_SharedLibraryUtil_getLibraryPath(JNIEnv *env, jclass clazz, jlong pLibAddress, jlong sOutAddress, jint bufSize) { + printf("LWJGL: Using phdr iterator code path\n"); UNUSED_PARAMS(env, clazz) void *pLib = (void *)(uintptr_t)pLibAddress; char *sOut = (char *)(uintptr_t)sOutAddress; @@ -328,6 +330,7 @@ EXTERN_C_ENTER JNIEXPORT int JNICALL Java_org_lwjgl_system_SharedLibraryUtil_getLibraryPath(JNIEnv *env, jclass clazz, jlong pLibAddress, jlong sOutAddress, jint bufSize) { + printf("LWJGL: Using suboptimal code path\n"); UNUSED_PARAMS(env, clazz) void *pLib = (void *)(uintptr_t)pLibAddress; char *sOut = (char *)(uintptr_t)sOutAddress;