Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / First Aid / April 2004

Tip: Looking for answers? Try searching our database.

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

Thread view: 
Nikita A. Visnevski - 21 Apr 2004 12:33 GMT
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
Chris Uppal - 21 Apr 2004 13:42 GMT
> 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
Roedy Green - 22 Apr 2004 06:35 GMT
>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.


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.