★ wanayoo — archive 1999 http://www.mail-archive.com/java-linux@java.blackdown.org/msg09595.htmlNouvelle recherche | Portail wanayoo
Mail Archive

java-linux

<-- Chronological -->
Find 
<-- Thread -->

Re: debuggers for Java-JNI-C++




Hi

I was hoping that somebody might come up with a better solution to the one I 
currently use ( as it's very flaky ) so I though I'd post the way I debug 
JNI on Linux.

1) Get a copy of ddd. ( Pleeeease don't post messages as to how you get it, 
it'll just piss of the rest of the guys )

2) Using the jdb feature of the debugger, start your application and place a 
break point on your native method.

3) When you hit the break point, startup another ddd session except use the 
attach feature to debug the (green) java program.

4) Set a breakpoint in your JNI code.

5) press the cont button on the C/C++ debug session.

6) press the cont button the Java session.


Yeah yeah yeah, I know its not great, but it works most of the time :-(

Or you could write you own program which loads the virtual machine and just 
use ddd on that, setting a breakpoint in your shared library or what 
ever.....


Best regards


--Jools




>From: Paul Beardsley <pab@merl.com>
>To: Juergen Kreileder <kreilede@issan.cs.uni-dortmund.de>
>CC: java-linux@java.blackdown.org
>Subject: Re: debuggers for Java-JNI-C++
>Date: Tue, 21 Sep 1999 12:07:43 -0400 (EDT)
>
>
>OK, but I'm running Java 2 SDK so I think I don't have
>access to a java_g - is there an alternative
>approach for Java 2?
>
>Paul.
>
>
>Juergen Kreileder writes:
>  >
>  >     Paul> Thanks, but how do I do that first step of
>  >     Paul> running a JVM under Java - is there a C
>  >     Paul> executable somewhere that runs a JVM,
>  >     Paul> so that I can gdb that executable?
>  >
>  > $ DEBUG_PROG=gdb java_g
>  > ...
>  > (gdb) run <classname>
>  >
>
>
>----------------------------------------------------------------------
>To UNSUBSCRIBE, email to java-linux-request@java.blackdown.org
>with a subject of "unsubscribe". Trouble? Contact 
>listadm@java.blackdown.org
>

______________________________________________________
Get Your Private, Free Email at http://www.hotmail.com


----------------------------------------------------------------------
To UNSUBSCRIBE, email to java-linux-request@java.blackdown.org
with a subject of "unsubscribe". Trouble? Contact listadm@java.blackdown.org

Reply via email to