Hi folks. Thanks to all of you who have responded so far...I've made
excellent progress and am almost there. Here's the scoop...

1. I've made sure the library in question is in the $LD_LIBRARY_PATH, and
has
been renamed to libBlah_g.so... in my case, I'm creating
libTest5Native.so, and renaming it to libTest5Native_g.so and then
copying it into /usr/lib. The _g part is required because Java, when it
runs in debug mode, expects the library names to end with _g

2. I then 'export DEBUG_PROG=gdb'

3. and then run 'java' (I'm running against IBM's JDK for Linux, if that
matters)

This causes the GNU debugger to start, and places me at the command
line. Now...I think I'm very close. I want to set a break point in native
code. The problem is, the native code hasn't been loaded yet because we
haven't run the Java class which will turn around and call the
System.loadLibrary("NativeTest5").

So...what I need to do is set a breakpoint in the native java executable
which actually loads the libraries. Once my Test5Native library is
loaded,
the native source should then be accessible to the debugger and I can set
break points and debug it...right?

On Solaris, the name of the routine which handles this in the java_g.so
is called dlopen ... this method signature differes from platform to
platform. I don't know what it is on Linux. I used nm on IBM's java_g.so
and found a method which looks very similar: dlopen@@GLIB_2.1 I tried
   stop dlopen@@GLIB_2.1
and then
   run test5.Main

The program runs, but the breakpoint (when my DLL is loaded) is never
encountered, so I never get a chance to set a breakpoint for local code.

Can anyone help? I need to know what routine I should be breaking on. I
can also use the blackdown JDK if need be (I'd like to be able to use
both).

Any suggestions appreciated...

TIA,
Christian
--------------------------------------------
Christian Cryder
Software Engineer - UHR Infrastructure
REALM Information Technologies -  http://www.realminfo.com
Adventures in UHR - http://realm.granitepeaks.com
Plugin Version Control for Java (PVCj 1.0) - http://www.pssg.com/pvcj
--------------------------------------------
     "What a great time to be a geek"
--------------------------------------------


----------------------------------------------------------------------
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to