1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta name="generator"
content="HTML Tidy for Linux/x86 (vers 1st February 2002), see www.w3.org" />
<title>Starting the Debuggee</title>
</head>
<body>
<h2>Starting the Debuggee</h2>
<p>The very first thing you are likely to do with JSwat is start
debugging your Java code. This is done through one of several
means.</p>
<ul>
<li>Using the "Start VM" item in the "VM"
menu, or the "new document" icon in the toolbar.</li>
<li>Using the <code>load</code> command. See the command
documentation using <code>help load</code> at the command
prompt.</li>
<li>Connecting to the remote debuggee. See the help on <a
href="help_remote.html">remote debugging</a> for more
information.</li>
</ul>
<p>The first option is typically the most popular since it involves
the least amount of typing and offers the most visual cues for the
required information. The rest of this help file will discuss this
option exclusively.</p>
<h3>The Fields</h3>
<p>The input fields of the Start VM dialog are described as
follows.</p>
<dl>
<dt><em>Java Home</em></dt>
<dd>This is the directory containing the Java runtime. Typically
this is filled in with a default value and does not need to be
adjusted. If at some point the location has changed, simply clear
the field to have JSwat rediscover the new location automatically
(after pressing OK to this dialog). If this fails for any reason,
you will need to enter the path to the "jre" directory
manually.</dd>
<dt><em>JVM Executable</em></dt>
<dd>This is the name of the <code>java</code> executable. The
default should be acceptable in nearly all cases, but should your
case differ, you can change the name to whatever is appropriate
for the Java runtime being used.</dd>
<dt><em>Debuggee VM Options</em></dt>
<dd>These are options to the debuggee JVM, such as
<code>-X<em>xxx</em></code>, <code>-hotspot</code>,
<code>-cp</code>, <code>-jar</code>, and <code>-D</code>. When
using the <code>-jar</code> option, you may put the name of the
jar file in this field or the Class name field described below.
However, the next time the Start VM dialog appears, the jar file
name will be in the Class name field.</dd>
<dt><em>Class name and arguments</em></dt>
<dd>Like the label says, this is the name of the class to be
debugged, along with any arguments expected by that class. If the
<code>-jar</code> option is used, this field holds the name of
the jar file rather than the name of the class. The jar file must
have the <strong>Main-Class</strong> property set in the manifest
for the <code>-jar</code> option to work.</dd>
</dl>
<h3>Canonicalized Options</h3>
<p>You may recall the option in the "Options" menu for
enabling the Classic VM support in the debuggee. With this feature
enabled, the <code>-classic</code> option will automatically be
used in launching the debuggee. However, the option will
<em>not</em> appear in the Start VM dialog's VM Options field.
The same is true for the classpath definition. You can define the
classpath using the <code>classpath</code> command or the "Set
Classpath" dialog, accessible from the "Options"
menu, and that will be passed to the debuggee automatically.</p>
<p>Both of these options are automatically added to the set of JVM
options given in the Start VM dialog during the launching process,
but only under certain conditions. For the Classic VM option, if
<code>-client</code>, <code>-hotspot</code>, <code>-server</code>,
or <code>-classic</code> option appears in the JVM options field,
then the Classic VM feature is silently ignored.</p>
<p>Similarly, if the JVM Options field contains the
<code>-cp</code> or <code>-classpath</code> option, the classpath
defined via the <code>classpath</code> command or the "Set
Classpath" dialog is ignored. Instead, the argument to the
<code>-cp</code> or <code>-classpath</code> option is used.</p>
<h3>Now What?</h3>
<p>After filling in the fields in the Start VM dialog, press the OK
button and wait a few seconds. You should soon see the debuggee JVM
start up and invoke the <code>main</code> method of the class named
in the dialog. Assuming your program does not exit immediately, you
are ready to begin debugging.</p>
<p>Now go back to the help index and read more about JSwat under
the General Topics section.</p>
</body>
</html>
|