src/linux/doc/man/jdb.1
author serb
Mon, 26 Mar 2018 16:09:22 -0700
changeset 49424 4269e701448e
parent 47216 71c04702a3d5
permissions -rw-r--r--
8200198: javah man pages were not removed by JDK-8191054 Reviewed-by: erikj, alanb
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
21743
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
     1
'\" t
31876
91b22707521a 8131105: Header Template for nroff man pages *.1 files contains errors
mfang
parents: 21743
diff changeset
     2
.\" Copyright (c) 1995, 2013, Oracle and/or its affiliates. All rights reserved.
91b22707521a 8131105: Header Template for nroff man pages *.1 files contains errors
mfang
parents: 21743
diff changeset
     3
.\" DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
91b22707521a 8131105: Header Template for nroff man pages *.1 files contains errors
mfang
parents: 21743
diff changeset
     4
.\"
91b22707521a 8131105: Header Template for nroff man pages *.1 files contains errors
mfang
parents: 21743
diff changeset
     5
.\" This code is free software; you can redistribute it and/or modify it
91b22707521a 8131105: Header Template for nroff man pages *.1 files contains errors
mfang
parents: 21743
diff changeset
     6
.\" under the terms of the GNU General Public License version 2 only, as
91b22707521a 8131105: Header Template for nroff man pages *.1 files contains errors
mfang
parents: 21743
diff changeset
     7
.\" published by the Free Software Foundation.
91b22707521a 8131105: Header Template for nroff man pages *.1 files contains errors
mfang
parents: 21743
diff changeset
     8
.\"
91b22707521a 8131105: Header Template for nroff man pages *.1 files contains errors
mfang
parents: 21743
diff changeset
     9
.\" This code is distributed in the hope that it will be useful, but WITHOUT
91b22707521a 8131105: Header Template for nroff man pages *.1 files contains errors
mfang
parents: 21743
diff changeset
    10
.\" ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
91b22707521a 8131105: Header Template for nroff man pages *.1 files contains errors
mfang
parents: 21743
diff changeset
    11
.\" FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
91b22707521a 8131105: Header Template for nroff man pages *.1 files contains errors
mfang
parents: 21743
diff changeset
    12
.\" version 2 for more details (a copy is included in the LICENSE file that
91b22707521a 8131105: Header Template for nroff man pages *.1 files contains errors
mfang
parents: 21743
diff changeset
    13
.\" accompanied this code).
91b22707521a 8131105: Header Template for nroff man pages *.1 files contains errors
mfang
parents: 21743
diff changeset
    14
.\"
91b22707521a 8131105: Header Template for nroff man pages *.1 files contains errors
mfang
parents: 21743
diff changeset
    15
.\" You should have received a copy of the GNU General Public License version
91b22707521a 8131105: Header Template for nroff man pages *.1 files contains errors
mfang
parents: 21743
diff changeset
    16
.\" 2 along with this work; if not, write to the Free Software Foundation,
91b22707521a 8131105: Header Template for nroff man pages *.1 files contains errors
mfang
parents: 21743
diff changeset
    17
.\" Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
91b22707521a 8131105: Header Template for nroff man pages *.1 files contains errors
mfang
parents: 21743
diff changeset
    18
.\"
91b22707521a 8131105: Header Template for nroff man pages *.1 files contains errors
mfang
parents: 21743
diff changeset
    19
.\" Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
91b22707521a 8131105: Header Template for nroff man pages *.1 files contains errors
mfang
parents: 21743
diff changeset
    20
.\" or visit www.oracle.com if you need additional information or have any
91b22707521a 8131105: Header Template for nroff man pages *.1 files contains errors
mfang
parents: 21743
diff changeset
    21
.\" questions.
91b22707521a 8131105: Header Template for nroff man pages *.1 files contains errors
mfang
parents: 21743
diff changeset
    22
.\"
21743
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
    23
.\"     Arch: generic
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
    24
.\"     Software: JDK 8
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
    25
.\"     Date: 21 November 2013
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
    26
.\"     SectDesc: Basic Tools
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
    27
.\"     Title: jdb.1
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
    28
.\"
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
    29
.if n .pl 99999
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
    30
.TH jdb 1 "21 November 2013" "JDK 8" "Basic Tools"
31876
91b22707521a 8131105: Header Template for nroff man pages *.1 files contains errors
mfang
parents: 21743
diff changeset
    31
.\" -----------------------------------------------------------------
91b22707521a 8131105: Header Template for nroff man pages *.1 files contains errors
mfang
parents: 21743
diff changeset
    32
.\" * Define some portability stuff
91b22707521a 8131105: Header Template for nroff man pages *.1 files contains errors
mfang
parents: 21743
diff changeset
    33
.\" -----------------------------------------------------------------
91b22707521a 8131105: Header Template for nroff man pages *.1 files contains errors
mfang
parents: 21743
diff changeset
    34
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
91b22707521a 8131105: Header Template for nroff man pages *.1 files contains errors
mfang
parents: 21743
diff changeset
    35
.\" http://bugs.debian.org/507673
91b22707521a 8131105: Header Template for nroff man pages *.1 files contains errors
mfang
parents: 21743
diff changeset
    36
.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
91b22707521a 8131105: Header Template for nroff man pages *.1 files contains errors
mfang
parents: 21743
diff changeset
    37
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
91b22707521a 8131105: Header Template for nroff man pages *.1 files contains errors
mfang
parents: 21743
diff changeset
    38
.ie \n(.g .ds Aq \(aq
91b22707521a 8131105: Header Template for nroff man pages *.1 files contains errors
mfang
parents: 21743
diff changeset
    39
.el       .ds Aq '
91b22707521a 8131105: Header Template for nroff man pages *.1 files contains errors
mfang
parents: 21743
diff changeset
    40
.\" -----------------------------------------------------------------
91b22707521a 8131105: Header Template for nroff man pages *.1 files contains errors
mfang
parents: 21743
diff changeset
    41
.\" * set default formatting
91b22707521a 8131105: Header Template for nroff man pages *.1 files contains errors
mfang
parents: 21743
diff changeset
    42
.\" -----------------------------------------------------------------
91b22707521a 8131105: Header Template for nroff man pages *.1 files contains errors
mfang
parents: 21743
diff changeset
    43
.\" disable hyphenation
91b22707521a 8131105: Header Template for nroff man pages *.1 files contains errors
mfang
parents: 21743
diff changeset
    44
.nh
91b22707521a 8131105: Header Template for nroff man pages *.1 files contains errors
mfang
parents: 21743
diff changeset
    45
.\" disable justification (adjust text to left margin only)
91b22707521a 8131105: Header Template for nroff man pages *.1 files contains errors
mfang
parents: 21743
diff changeset
    46
.ad l
91b22707521a 8131105: Header Template for nroff man pages *.1 files contains errors
mfang
parents: 21743
diff changeset
    47
.\" -----------------------------------------------------------------
91b22707521a 8131105: Header Template for nroff man pages *.1 files contains errors
mfang
parents: 21743
diff changeset
    48
.\" * MAIN CONTENT STARTS HERE *
91b22707521a 8131105: Header Template for nroff man pages *.1 files contains errors
mfang
parents: 21743
diff changeset
    49
.\" -----------------------------------------------------------------
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    50
21743
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
    51
.SH NAME    
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
    52
jdb \- Finds and fixes bugs in Java platform programs\&.
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
    53
.SH SYNOPSIS    
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
    54
.sp     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
    55
.nf     
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    56
21743
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
    57
\fBjdb\fR [\fIoptions\fR] [\fIclassname\fR]  [\fIarguments\fR]
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
    58
.fi     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
    59
.sp     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
    60
.TP     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
    61
\fIoptions\fR
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
    62
Command-line options\&. See Options\&.
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
    63
.TP     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
    64
\fIclass\fRname
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
    65
Name of the main class to debug\&.
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
    66
.TP     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
    67
\fIarguments\fR
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
    68
Arguments passed to the \f3main()\fR method of the class\&.
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
    69
.SH DESCRIPTION    
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
    70
The Java Debugger (JDB) is a simple command-line debugger for Java classes\&. The \f3jdb\fR command and its options call the JDB\&. The \f3jdb\fR command demonstrates the Java Platform Debugger Architecture (JDBA) and provides inspection and debugging of a local or remote Java Virtual Machine (JVM)\&. See Java Platform Debugger Architecture (JDBA) at http://docs\&.oracle\&.com/javase/8/docs/technotes/guides/jpda/index\&.html
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
    71
.SS START\ A\ JDB\ SESSION    
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
    72
There are many ways to start a JDB session\&. The most frequently used way is to have JDB launch a new JVM with the main class of the application to be debugged\&. Do this by substituting the \f3jdb\fR command for the \f3java\fR command in the command line\&. For example, if your application\&'s main class is \f3MyClass\fR, then use the following command to debug it under JDB:
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
    73
.sp     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
    74
.nf     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
    75
\f3jdb MyClass\fP
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
    76
.fi     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
    77
.nf     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
    78
\f3\fP
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
    79
.fi     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
    80
.sp     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
    81
When started this way, the \f3jdb\fR command calls a second JVM with the specified parameters, loads the specified class, and stops the JVM before executing that class\&'s first instruction\&.
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
    82
.PP
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
    83
Another way to use the \f3jdb\fR command is by attaching it to a JVM that is already running\&. Syntax for starting a JVM to which the \f3jdb\fR command attaches when the JVM is running is as follows\&. This loads in-process debugging libraries and specifies the kind of connection to be made\&.
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
    84
.sp     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
    85
.nf     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
    86
\f3java \-agentlib:jdwp=transport=dt_socket,server=y,suspend=n MyClass\fP
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
    87
.fi     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
    88
.nf     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
    89
\f3\fP
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
    90
.fi     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
    91
.sp     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
    92
You can then attach the \f3jdb\fR command to the JVM with the following command:
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
    93
.sp     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
    94
.nf     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
    95
\f3jdb \-attach 8000\fP
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
    96
.fi     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
    97
.nf     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
    98
\f3\fP
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
    99
.fi     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   100
.sp     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   101
The \f3MyClass\fR argument is not specified in the \f3jdb\fR command line in this case because the \f3jdb\fR command is connecting to an existing JVM instead of launching a new JVM\&.
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   102
.PP
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   103
There are many other ways to connect the debugger to a JVM, and all of them are supported by the \f3jdb\fR command\&. The Java Platform Debugger Architecture has additional documentation on these connection options\&.
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   104
.SS BASIC\ JDB\ COMMANDS    
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   105
The following is a list of the basic \f3jdb\fR commands\&. The JDB supports other commands that you can list with the \f3-help\fR option\&.
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   106
.TP     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   107
help or ?
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   108
The \f3help\fR or \f3?\fR commands display the list of recognized commands with a brief description\&.
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   109
.TP     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   110
run
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   111
After you start JDB and set breakpoints, you can use the \f3run\fR command to execute the debugged application\&. The \f3run\fR command is available only when the \f3jdb\fR command starts the debugged application as opposed to attaching to an existing JVM\&.
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   112
.TP     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   113
cont
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   114
Continues execution of the debugged application after a breakpoint, exception, or step\&.
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   115
.TP     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   116
print
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   117
Displays Java objects and primitive values\&. For variables or fields of primitive types, the actual value is printed\&. For objects, a short description is printed\&. See the dump command to find out how to get more information about an object\&.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   118
21743
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   119
\fINote:\fR To display local variables, the containing class must have been compiled with the \f3javac -g\fR option\&.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   120
21743
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   121
The \f3print\fR command supports many simple Java expressions including those with method invocations, for example:
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   122
.sp     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   123
.nf     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   124
\f3print MyClass\&.myStaticField\fP
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   125
.fi     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   126
.nf     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   127
\f3print myObj\&.myInstanceField\fP
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   128
.fi     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   129
.nf     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   130
\f3print i + j + k (i, j, k are primities and either fields or local variables)\fP
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   131
.fi     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   132
.nf     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   133
\f3print myObj\&.myMethod() (if myMethod returns a non\-null)\fP
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   134
.fi     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   135
.nf     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   136
\f3print new java\&.lang\&.String("Hello")\&.length()\fP
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   137
.fi     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   138
.nf     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   139
\f3\fP
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   140
.fi     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   141
.sp     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   142
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   143
.TP     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   144
dump
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   145
For primitive values, the \f3dump\fR command is identical to the \f3print\fR command\&. For objects, the \f3dump\fR command prints the current value of each field defined in the object\&. Static and instance fields are included\&. The \f3dump\fR command supports the same set of expressions as the \f3print\fR command\&.
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   146
.TP     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   147
threads
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   148
List the threads that are currently running\&. For each thread, its name and current status are printed and an index that can be used in other commands\&. In this example, the thread index is 4, the thread is an instance of \f3java\&.lang\&.Thread\fR, the thread name is \f3main\fR, and it is currently running\&.
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   149
.sp     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   150
.nf     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   151
\f34\&. (java\&.lang\&.Thread)0x1 main      running\fP
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   152
.fi     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   153
.nf     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   154
\f3\fP
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   155
.fi     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   156
.sp     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   157
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   158
.TP     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   159
thread
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   160
Select a thread to be the current thread\&. Many \f3jdb\fR commands are based on the setting of the current thread\&. The thread is specified with the thread index described in the threads command\&.
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   161
.TP     
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   162
where
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   163
The \f3where\fR command with no arguments dumps the stack of the current thread\&. The \f3where\fR\f3all\fR command dumps the stack of all threads in the current thread group\&. The \f3where\fR\f3threadindex\fR command dumps the stack of the specified thread\&.
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   164
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   165
If the current thread is suspended either through an event such as a breakpoint or through the \f3suspend\fR command, then local variables and fields can be displayed with the \f3print\fR and \f3dump\fR commands\&. The \f3up\fR and \f3down\fR commands select which stack frame is the current stack frame\&.
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   166
.SS BREAKPOINTS    
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   167
Breakpoints can be set in JDB at line numbers or at the first instruction of a method, for example:
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   168
.TP 0.2i    
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   169
\(bu
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   170
The command \f3stop at MyClass:22\fR sets a breakpoint at the first instruction for line 22 of the source file containing \f3MyClass\fR\&.
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   171
.TP 0.2i    
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   172
\(bu
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   173
The command \f3stop in java\&.lang\&.String\&.length\fR sets a breakpoint at the beginning of the method \f3java\&.lang\&.String\&.length\fR\&.
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   174
.TP 0.2i    
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   175
\(bu
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   176
The command \f3stop in MyClass\&.<clinit>\fR uses \f3<clinit>\fR to identify the static initialization code for \f3MyClass\fR\&.
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   177
.PP
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   178
When a method is overloaded, you must also specify its argument types so that the proper method can be selected for a breakpoint\&. For example, \f3MyClass\&.myMethod(int,java\&.lang\&.String)\fR or \f3MyClass\&.myMethod()\fR\&.
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   179
.PP
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   180
The \f3clear\fR command removes breakpoints using the following syntax: \f3clear MyClass:45\fR\&. Using the \f3clear\fR or \f3stop\fR command with no argument displays a list of all breakpoints currently set\&. The \f3cont\fR command continues execution\&.
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   181
.SS STEPPING    
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   182
The \f3step\fR command advances execution to the next line whether it is in the current stack frame or a called method\&. The \f3next\fR command advances execution to the next line in the current stack frame\&.
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   183
.SS EXCEPTIONS    
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   184
When an exception occurs for which there is not a \f3catch\fR statement anywhere in the throwing thread\&'s call stack, the JVM typically prints an exception trace and exits\&. When running under JDB, however, control returns to JDB at the offending throw\&. You can then use the \f3jdb\fR command to diagnose the cause of the exception\&.
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   185
.PP
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   186
Use the \f3catch\fR command to cause the debugged application to stop at other thrown exceptions, for example: \f3catch java\&.io\&.FileNotFoundException\fR or \f3catch\fR\f3mypackage\&.BigTroubleException\fR\&. Any exception that is an instance of the specified class or subclass stops the application at the point where it is thrown\&.
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   187
.PP
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   188
The \f3ignore\fR command negates the effect of an earlier \f3catch\fR command\&. The \f3ignore\fR command does not cause the debugged JVM to ignore specific exceptions, but only to ignore the debugger\&.
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   189
.SH OPTIONS    
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   190
When you use the \f3jdb\fR command instead of the \f3java\fR command on the command line, the \f3jdb\fR command accepts many of the same options as the \f3java\fR command, including \f3-D\fR, \f3-classpath\fR, and \f3-X\fR options\&. The following list contains additional options that are accepted by the \f3jdb\fR command\&.
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   191
.PP
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   192
Other options are supported to provide alternate mechanisms for connecting the debugger to the JVM it is to debug\&. For additional documentation about these connection alternatives, see Java Platform Debugger Architecture (JPDA) at http://docs\&.oracle\&.com/javase/8/docs/technotes/guides/jpda/index\&.html
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   193
.TP
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   194
-help
9573
c02ff5a7c67b 7043684: Update man pages for JDK 7 tools
bpatel
parents: 5865
diff changeset
   195
.br
21743
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   196
Displays a help message\&.
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   197
.TP
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   198
-sourcepath \fIdir1:dir2: \&. \&. \&.\fR
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   199
.br
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   200
Uses the specified path to search for source files in the specified path\&. If this option is not specified, then use the default path of dot (\&.)\&.
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   201
.TP
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   202
-attach \fIaddress\fR
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   203
.br
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   204
Attaches the debugger to a running JVM with the default connection mechanism\&.
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   205
.TP
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   206
-listen \fIaddress\fR
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   207
.br
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   208
Waits for a running JVM to connect to the specified address with a standard connector\&.
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   209
.TP
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   210
-launch
9573
c02ff5a7c67b 7043684: Update man pages for JDK 7 tools
bpatel
parents: 5865
diff changeset
   211
.br
21743
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   212
Starts the debugged application immediately upon startup of JDB\&. The \f3-launch\fR option removes the need for the \f3run\fR command\&. The debugged application is launched and then stopped just before the initial application class is loaded\&. At that point, you can set any necessary breakpoints and use the \f3cont\fR command to continue execution\&.
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   213
.TP
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   214
-listconnectors
9573
c02ff5a7c67b 7043684: Update man pages for JDK 7 tools
bpatel
parents: 5865
diff changeset
   215
.br
21743
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   216
List the connectors available in this JVM\&.
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   217
.TP
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   218
-connect connector-name:\fIname1=value1\fR
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   219
.br
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   220
Connects to the target JVM with the named connector and listed argument values\&.
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   221
.TP
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   222
-dbgtrace [\fIflags\fR]
9573
c02ff5a7c67b 7043684: Update man pages for JDK 7 tools
bpatel
parents: 5865
diff changeset
   223
.br
21743
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   224
Prints information for debugging the \f3jdb\fR command\&.
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   225
.TP
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   226
-tclient
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   227
.br
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   228
Runs the application in the Java HotSpot VM client\&.
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   229
.TP
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   230
-tserver
9573
c02ff5a7c67b 7043684: Update man pages for JDK 7 tools
bpatel
parents: 5865
diff changeset
   231
.br
21743
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   232
Runs the application in the Java HotSpot VM server\&.
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   233
.TP
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   234
-J\fIoption\fR
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   235
.br
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   236
Passes \f3option\fR to the JVM, where option is one of the options described on the reference page for the Java application launcher\&. For example, \f3-J-Xms48m\fR sets the startup memory to 48 MB\&. See java(1)\&.
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   237
.SH OPTIONS\ FORWARDED\ TO\ THE\ DEBUGGER\ PROCESS    
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   238
.TP
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   239
-v -verbose[:\fIclass\fR|gc|jni]
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   240
.br
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   241
Turns on verbose mode\&.
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   242
.TP
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   243
-D\fIname\fR=\fIvalue\fR
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   244
.br
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   245
Sets a system property\&.
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   246
.TP
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   247
-classpath \fIdir\fR
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   248
.br
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   249
Lists directories separated by colons in which to look for classes\&.
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   250
.TP
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   251
-X\fIoption\fR
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   252
.br
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   253
Nonstandard target JVM option\&.
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   254
.SH SEE\ ALSO    
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   255
.TP 0.2i    
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   256
\(bu
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   257
javac(1)
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   258
.TP 0.2i    
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   259
\(bu
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   260
java(1)
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   261
.TP 0.2i    
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   262
\(bu
3d979da7bdf0 8029043: Update nroff files for JDK 8
rgallard
parents: 9573
diff changeset
   263
javap(1)
31876
91b22707521a 8131105: Header Template for nroff man pages *.1 files contains errors
mfang
parents: 21743
diff changeset
   264
.RE
91b22707521a 8131105: Header Template for nroff man pages *.1 files contains errors
mfang
parents: 21743
diff changeset
   265
.br
91b22707521a 8131105: Header Template for nroff man pages *.1 files contains errors
mfang
parents: 21743
diff changeset
   266
'pl 8.5i
91b22707521a 8131105: Header Template for nroff man pages *.1 files contains errors
mfang
parents: 21743
diff changeset
   267
'bp