Jacob and others,

        I have just spent a couple of days making my debugger run on Linux.  It was
not an easy task, so I thought I would share some of the wisdom I gained
along the way.  I would point out that these are just the best data I have,
and if I am incorrect on any of these point I apologize in advance.

        First a little background on me.  My name is Zack Grossbart.  I work for
SilverStream Software in Burlington MA (http://www.silverstream.com).  We
are working on a Linux version of our IDE which includes a debugger.  The
debugger I am using is the SilverStream debugger.  This debugger leverages
the Java Platform Debugging Architecture (JPDA) and the Java Virtual Machine
Debugging Interface (JVMDI).

        Here are the lessons I have learned (in no particular order).

        Debugging does not work using native threads.
        When I start my JVM with the proper flags to use debugging and my JVM uses
native thread my JVM will crash.
        In order to run with green threads you can either set up your environment,
or just use the -green flag.

        There is no shared memory debugging on Linux.
        I don't know this for a fact, but the JVM complains when started with
socket debugging.

        You must specify a bootclasspath that contains the location of the rt.jar
and the tools.jar.

        So... Here is what I run when starting the JVM:


java -green -Djava.compiler=NONE -debug -Xnoagent -Xbootclasspath:/path/to/j
dk/jre/lib/rt.jar:/path/to/jdk/jre/lib/tools.jar -Xrunjdwp:transport=dt_sock
et,address=anOpenPort,server=y,suspend=n myClass

Here are what the options mean:

-green                          Use green threads
-Djava.compiler=NONE            Don't use the JIT
-Xnoagent                               Run without an agent
-Xbootclasspath:                        The boot class path
-Xrunjdwp:                              Specifying debug options
transport=dt_socket             Use socket debugging
address=anOpenPort              Open the socket at this port
                Note: I dynamically find an available high port
server=y                                Accept debug clients
suspend=n                               Do not start the JVM suspended

        As far as being a breakpoint listener, I am writing my own breakpoint
listener using JVMDI and JPDA.  I don't think this is what most people are
trying to do, so I won't mention the gory details.  Suffice to say, there is
a lot of code.

        I hope this helps.  There is more information about the command line debug
options at the following URL, which Nathan sent,
(http://java.sun.com/products/jpda/doc/conninv.html).

        Good luck

Zack


> -----Original Message-----
> From: Jacob Nikom [mailto:[EMAIL PROTECTED]]
> Sent: Friday, April 21, 2000 1:47 PM
> To: Zack Grossbart
> Cc: Nathan Meyers; noisebrain; [EMAIL PROTECTED];
> [EMAIL PROTECTED]
> Subject: Re: jdb tips?
>
>
>
> Hi Zack,
>
> Which debugger you used? jdb?
> What commands did you run in order to make it work?
> Could you write short notice for other people how
> to run a debugger?
>
> Jacob
>


----------------------------------------------------------------------
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to