Nathan Meyers wrote:
> 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()
I am not able to do this,
black:rpatel% java -green "Fsa -interactive -outfile logfile"
GNU gdb 4.17.0.11 with Linux support
Copyright 1998 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB. Type "show warranty" for details.
This GDB was configured as "i386-redhat-linux"...
/usr/safdevel/JSAF/libsrc/libfsa/Fsa -interactive -outfile logfile: No such file
or directory.
(gdb) b Fsa:1565
No source file named Fsa.
(gdb) b Fsa.java:1565
No source file named Fsa.java.
(gdb) b Fsa.class:1565
No source file named Fsa.class.
(gdb) b netif.cc:165
No source file named netif.cc.
(gdb)
What am i missing??
-Raj
>
> 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]