There isn't really a gdb-jdb combination. You can debug under gdb if
you want to debug native code, but you won't get source-level Java
debugging.
There are some tricks to getting your debugging session started under
gdb, because the breakpoint needs to be set in a library (your JNI code)
that isn't loaded at gdb startup. These steps can get you debugging
native code:
1) export LD_PRELOAD=<name of your JNI library>
2) export DEBUG_PROG=gdb (or whatever debugger you want to use)
3) Run your application with green threads (java -green ...)
4) When the debugger starts up, set a breakpoint at main()
5) Run the program... be sure to specify the command-line args for java
6) When you hit the breakpoint in main(), set a breakpoint in your
JNI code
7) Continue execution; gdb will stop when it hits your breakpoint.
Nathan
On Fri, Nov 12, 1999 at 02:02:09PM -0500, Raj Patel wrote:
> Nathan Meyers wrote:
>
> > I think you didn't get an answer because, in general, people are
> > successfully using Swing and JNI with the JDK1.2 and nobody recognized
> > your problem.
>
> Thanks for the response. I found the problem. Now i have some trouble in
> native calls. I have Redhat Linux 6.0 with glibc2.1(my mistake i said 2.0).
> I want to debug my native code(C++) using gdb . I tried using attach process
> id at gdb session but i did not get anything useful in my gdb sesson.
>
> Is anybody familiar with jdb-gdb combination for debugging java code with
> JNI??
> I found most of the places with referenses to dbx which i don't have on
> linux.
> Thanks,
>
> -Raj
----------------------------------------------------------------------
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]