1 <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 |
|
10 generates a trace of its execution. <B>Trace</B> is a simple command |
|
11 line tool that uses the |
|
12 <A HREF="http://java.sun.com/j2se/1.4/docs/guide/jpda/architecture.html#jdi"> |
|
13 Java Debug Interface (JDI)</A>. Programs need |
|
14 not be compiled for debugging since this information is not |
|
15 used. |
|
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> |
|
21 Your classpath must include the JDI Library |
|
22 (see <A HREF="index.html#SETUP">set-up</A>), |
|
23 the path to the compiled <b>trace</b> class files, |
|
24 and the path for the application being traced. |
|
25 <P> |
|
26 Available <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> |
|
49 Full source code for <b>trace</b> is included in the |
|
50 <code>trace</code> directory of <code>examples.jar</code>. |
|
51 Source code for these example applications is included to provide concrete |
|
52 examples for debugger developers. Example code may be used, modified |
|
53 and redistributed by debugger developers providing they adhere to the |
|
54 terms in the COPYRIGHT notice. |
|
55 |
|
56 <P> |
|
57 <H2>Building trace</H2> |
|
58 To completely rebuild the <b>trace</b> classes from the |
|
59 provided source files in the <code>trace</code> directory, |
|
60 you need only to compile them. No special |
|
61 options are required, aside from those which set your classpath to |
|
62 include 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> |
|