From 916c9a11836a0a78176e138c19521a118eff350f Mon Sep 17 00:00:00 2001 From: Sven Gothel Date: Fri, 5 Jun 2009 05:06:52 +0000 Subject: Better debug/verbose output git-svn-id: file:///usr/local/projects/SUN/JOGL/git-svn/../svn-server-sync/gluegen/branches/JOGL_2_SANDBOX@142 a78bb65f-1512-4460-ba86-f6dc96a7bf27 --- src/java/com/sun/gluegen/runtime/DynamicLookupHelper.java | 3 +++ src/java/com/sun/gluegen/runtime/ProcAddressHelper.java | 2 +- src/java/com/sun/gluegen/runtime/opengl/GLProcAddressHelper.java | 8 +++----- 3 files changed, 7 insertions(+), 6 deletions(-) (limited to 'src/java/com/sun/gluegen') diff --git a/src/java/com/sun/gluegen/runtime/DynamicLookupHelper.java b/src/java/com/sun/gluegen/runtime/DynamicLookupHelper.java index 07417f9..ad3de7f 100755 --- a/src/java/com/sun/gluegen/runtime/DynamicLookupHelper.java +++ b/src/java/com/sun/gluegen/runtime/DynamicLookupHelper.java @@ -46,5 +46,8 @@ package com.sun.gluegen.runtime; code. */ public interface DynamicLookupHelper { + /** + * Try to fetch the function pointer for function 'funcName'. + */ public long dynamicLookupFunction(String funcName); } diff --git a/src/java/com/sun/gluegen/runtime/ProcAddressHelper.java b/src/java/com/sun/gluegen/runtime/ProcAddressHelper.java index 7e2708f..f0dbe8b 100644 --- a/src/java/com/sun/gluegen/runtime/ProcAddressHelper.java +++ b/src/java/com/sun/gluegen/runtime/ProcAddressHelper.java @@ -107,7 +107,7 @@ public class ProcAddressHelper { // set the current value of the proc address variable in the table object addressField.setLong(table, newProcAddress); if (DEBUG) { - dout.println(" " + addressField.getName() + " = 0x" + Long.toHexString(newProcAddress)); + dout.println(" " + addressField.getName() + " -> 0x" + Long.toHexString(newProcAddress)); } } catch (Exception e) { throw new RuntimeException("Can not get proc address for method \"" + diff --git a/src/java/com/sun/gluegen/runtime/opengl/GLProcAddressHelper.java b/src/java/com/sun/gluegen/runtime/opengl/GLProcAddressHelper.java index 3f88261..4110b6f 100644 --- a/src/java/com/sun/gluegen/runtime/opengl/GLProcAddressHelper.java +++ b/src/java/com/sun/gluegen/runtime/opengl/GLProcAddressHelper.java @@ -76,12 +76,10 @@ public class GLProcAddressHelper extends ProcAddressHelper { } long newProcAddress = 0; int funcNamePermNum = GLExtensionNames.getFuncNamePermutationNumber(funcNameBase); + String funcName = null; for(int j = 0; 0==newProcAddress && j < funcNamePermNum; j++) { - String funcName = GLExtensionNames.getFuncNamePermutation(funcNameBase, j); + funcName = GLExtensionNames.getFuncNamePermutation(funcNameBase, j); try { - if (DEBUG) { - dout.println(" try function lookup: " + funcName + " / " + funcNameBase); - } newProcAddress = lookup.dynamicLookupFunction(funcName); } catch (Exception e) { if (DEBUG) { @@ -94,7 +92,7 @@ public class GLProcAddressHelper extends ProcAddressHelper { // set the current value of the proc address variable in the table object addressField.setLong(table, newProcAddress); if (DEBUG) { - dout.println(" " + addressField.getName() + " = 0x" + Long.toHexString(newProcAddress)); + dout.println(" " + addressField.getName() + " "+funcName+" -> 0x" + Long.toHexString(newProcAddress)); } } catch (Exception e) { throw new RuntimeException("Can not set proc address field for method \"" + -- cgit v1.2.3