blob: 8cae84dfe1e8a491e5ba8eb6c33a8e09fee467e8 [file] [log] [blame]
J. Duke319a3b92007-12-01 00:00:00 +00001<HTML>
2<HEAD>
3 <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
4 <TITLE>trace example</TITLE>
5</HEAD>
6<BODY TEXT="#000000" BGCOLOR="#FFFFFF" LINK="#0000FF" VLINK="#000077" ALINK="#FF0000">
7<H2>trace example</H2>
8
9<B>Trace</B> runs the Java language program passed as an argument and
10generates a trace of its execution. <B>Trace</B> is a simple command
11line tool that uses the
12<A HREF="http://java.sun.com/j2se/1.4/docs/guide/jpda/architecture.html#jdi">
13Java Debug Interface (JDI)</A>. Programs need
14not be compiled for debugging since this information is not
15used.
16<P>
17<B>Trace</B> can be invoked as follows:
18<PRE>
19 java com.sun.tools.example.trace.Trace <i>options class args</i>
20</PRE>
21Your classpath must include the JDI Library
22(see <A HREF="index.html#SETUP">set-up</A>),
23the path to the compiled <b>trace</b> class files,
24and the path for the application being traced.
25<P>
26Available <i>options</i> are:
27
28<PRE>
29 -output <i>filename</i>
30 Set destination for output trace. By default output
31 goes to the terminal.
32
33 -all
34 Include system classes in output. By default
35 java.*, javax.*, sun.* and com.sun.* events are
36 not diplayed.
37
38 -fields
39 Also show assignments into fields.
40
41 -help
42 Print a help message
43
44</PRE>
45<i>class</i> is the program to trace. <i>args</i> are the arguments to <i>class</i>.
46<P>
47
48<H2>Source for trace</H2>
49Full source code for <b>trace</b> is included in the
50<code>trace</code> directory of <code>examples.jar</code>.
51Source code for these example applications is included to provide concrete
52examples for debugger developers. Example code may be used, modified
53and redistributed by debugger developers providing they adhere to the
54terms in the COPYRIGHT notice.
55
56<P>
57<H2>Building trace</H2>
58To completely rebuild the <b>trace</b> classes from the
59provided source files in the <code>trace</code> directory,
60you need only to compile them. No special
61options are required, aside from those which set your classpath to
62include the <A HREF="index.html#SETUP">JDI Library</A>.
63
64<P>
65 <hr>
66 <address><a href="mailto:java-debugger@java.sun.com">java-debugger@java.sun.com</a></address>
67 </P>
68<P>
69</P>
70</BODY>
71</HTML>