f



Help debugging Java code with Java 1.3.1_01 Java HotSpot Client VM (jvm.dll)

Hi everybody,

I am seeking help in my attempt to configure proper debugging 
functionality for my classes with an application on a win32 platform 
that uses Java HotSpot(TM) Client VM (JRE 1.3.1_01 - jvm.dll).  For 
those of you that may actually know this application, it is Matlab.  For 
those not familiar, it is an executable that links jvm.dll.

I have a number of Java IDEs (Sun ONE Studio, JBuilder, NetBeans) and I 
would appreciate help in setting up at least one of them to be able to 
debug my classes.

Does anybody have an idea where to start?  I think I have figured out a 
way to pass the -Xdebug option into the JVM, but it did not really do me 
any good so far.  Any help is appreciated.

Nik

0
4/21/2004 11:33:21 AM
comp.lang.java.softwaretools 2938 articles. 1 followers. Post Follow

2 Replies
1524 Views

Similar Articles

[PageSpeed] 8

Nikita A. Visnevski wrote:

> I am seeking help in my attempt to configure proper debugging
> functionality for my classes with an application on a win32 platform
> that uses Java HotSpot(TM) Client VM (JRE 1.3.1_01 - jvm.dll).  For
> those of you that may actually know this application, it is Matlab.  For
> those not familiar, it is an executable that links jvm.dll.

I can't help directly, but once managed to do something somewhat similar.

I have a Windows application that links the JVM in the same kind of way as
Matlab and I've managed to get the Eclipse debugger to connect (rather shakily)
to Java code running inside my app.

Unfortunately, I was using Java 1.4 not 1.3, and I'm fairly sure that there
were some changes in this area -- if only in reliability.  Still, you might be
able to switch to a 1.4 JVM to do your debugging it you can't get it to work
under 1.3 (I don't /think/ it would affect Matlab too much).

Anyway to get it to work with Eclipse 2.x (which wasn't on your list, I know,
but presumably the principles are the same with other debuggers) I had to pass
flags to the jvm.dll to:
    Give -Xdebug argument
    Ensure that the Eclipse-generated .class files were first on its classpath.
    Tell it to start listening for connections from the debugger.

So the options were:
    -Xdebug
    -Djava.class.path=<...whatever...>
    -Xrunjdwp:transport=dt_socket,address=7777,server=y,suspend=n

The last option tells the JVM to start a server listening for inbound TCP/IP
connections from the debugger on port 7777 (arbitrarily chosen), and not to
wait for the connection to be established before starting up.

I then had to tell Eclipse to connect to a running Java application that was
listening on that port on 'localhost'.  Offhand I can't remember how to do
that, but since you aren't using Eclipse I don't suppose the details would help
you very much anyway.

It's some time since I did this.  IIRC there were some issues about
disconnecting from the debugged application -- it didn't work, or crashed the
application, or something like that, so be cautious...

HTH

    -- chris



0
chris.uppal (3980)
4/21/2004 12:42:54 PM
On Wed, 21 Apr 2004 07:33:21 -0400, "Nikita A. Visnevski"
<NikitaVisnevski@netscape.net> wrote or quoted :

>
>Does anybody have an idea where to start?  I think I have figured out a 
>way to pass the -Xdebug option into the JVM, but it did not really do me 
>any good so far.  Any help is appreciated.

see http://mindprod.com/debugging.html
http://mindprod.com/jgloss/debugger.html
http://mindprod.com/jgloss/trace.html

--
Canadian Mind Products, Roedy Green.
Coaching, problem solving, economical contract programming. 
See http://mindprod.com/jgloss/jgloss.html for The Java Glossary.
0
see746 (499)
4/22/2004 5:35:31 AM
Reply: