Skip Masthead Links developers.sun.com   » search tips  |  Search:     
The Source for Developers
A Sun Developer Network Site
Products and Technologies
Technical Topics
Sun Microsystems
 
 
Tested Configurations
Java Platform Debugger Architecture
 

Trace runs the Java language program passed as an argument and generates a trace of its execution. Trace is a simple command line tool that uses the Java Debug Interface (JDI). Programs need not be compiled for debugging since this information is not used.

Trace can be invoked as follows:

        java Trace options class args
Your classpath must include the Java 2 SDK's lib/tools.jar file which contains the JDI Library (see set-up), the path to the compiled trace class files, and the path for the application being traced.

Available options are:
  -output filename
Set destination for output trace. By default output
goes to the terminal.

-all
Include system classes in output. By default
java.*, javax.*, sun.* and com.sun.* events are
not diplayed.

-fields
Also show assignments into fields.

-help
Print a help message


class is the program to trace. args are the arguments to class.

Source for trace

Full source code for trace is included in the trace directory of examples.jar. Source code of these example application is included to provide concrete examples for debugger developers. Example code may be used, modified and redistributed by debugger developers providing they adhere to the terms in the copyright notice.

Building trace

To completely rebuild the trace classes from the provided source files in the trace directory, you need only to compile them. No special options are required, aside from those which set your classpath to include the JDI Library in lib/tools.jar.