File: remote.html

package info (click to toggle)
jswat 1.7-2
  • links: PTS
  • area: contrib
  • in suites: etch, etch-m68k
  • size: 5,656 kB
  • ctags: 3,210
  • sloc: java: 24,683; xml: 130; makefile: 59; sh: 21
file content (71 lines) | stat: -rw-r--r-- 2,973 bytes parent folder | download
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
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

<html>
  <head>
    <meta name="generator" content=
    "HTML Tidy for Linux/x86 (vers 1st February 2002), see www.w3.org">

    <title>Remote Debugging</title>
  </head>

  <body bgcolor="#ffffff">
    <h2>Remote Debugging</h2>

    <h3>Attaching to a Running Program</h3>

    <p>To debug a program that is already running, you must have
    started that program using the following command line:</p>
<pre>
% java -Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp:transport=dt_socket,server=y,suspend=n &lt;class&gt;
</pre>

    <p>This will start the JPDA debugger back-end and run the given
    class. The socket transport will be used and the back-end will act
    as the server. This allows JSwat to connect to the debugger
    back-end by using the &#39;<code>attach</code>&#39; JSwat command.
    The debugger back-end will print a four-digit number in the command
    shell where you invoked &#39;<code>java</code>&#39;. This is the
    socket port number that JSwat must connect to.</p>

    <p>Once you have started JSwat and the debuggee program is running,
    you can type &quot;<code>attach &lt;port&gt;</code>&quot; to attach
    to the debugger back-end through the given port number. JSwat
    should say &quot;VM attached&quot; when successful.</p>

    <h3>Detaching from a Running Program</h3>

    <p>To end the remote debugging session, invoke the command
    &#39;<code>detach</code>&#39; or &#39;<code>close</code>&#39;.
    Either one of these commands will close the connection with the
    debuggee VM and leave it running. If you invoke the
    &#39;<code>kill</code>&#39; command instead, this will terminate
    the debuggee VM.</p>

    <h3>Listening for a Connection</h3>

    <p>In addition to connecting to an already running remote VM, JSwat
    can listen for connections from new VMs. This is done using the
    &#39;<code>listen</code>&#39; command. It takes an optional port
    number to listen to, or uses a default as generated by the JPDA.
    While JSwat is listening for a remote VM to connect, you may launch
    the remote debuggee using something like the following:</p>
<pre>
% java -Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp:transport=dt_socket,address=&lt;port&gt; &lt;class&gt;
</pre>

    <p>For the <code>&lt;port&gt;</code> value, substitute the value
    returned from the &#39;<code>listen</code>&#39; command. Enter the
    name of the class you want to debug in place of the
    <code>&lt;class&gt;</code> argument. Once the remote VM starts up,
    JSwat will activate a new debugging session and will be ready for
    your input.</p>

    <h3>For More Information</h3>

    <p>Check out the thorough documentation available for the JPDA
    libraries. These docs come with the JDK documentation for JDK 1.3
    and above. Be sure to read up on the JPDA connectors to learn all
    the options when remotely debugging.</p>
  </body>
</html>