.'" t ." ." Copyright 2000-2006 Sun Microsystems, Inc. All Rights Reserved. ." DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. ." ." This code is free software; you can redistribute it and/or modify it ." under the terms of the GNU General Public License version 2 only, as ." published by the Free Software Foundation. ." ." This code is distributed in the hope that it will be useful, but WITHOUT ." ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or ." FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License ." version 2 for more details (a copy is included in the LICENSE file that ." accompanied this code). ." ." You should have received a copy of the GNU General Public License version ." 2 along with this work; if not, write to the Free Software Foundation, ." Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. ." ." Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA ." or visit www.oracle.com if you need additional information or have any ." questions. ." ." ` jdb - Online Linux Manual PageSection : 1
Updated : 05 Aug 2006
." Generated by html2roff
NAMEjdb − The Java Debugger jdb helps you find and fix bugs in Java language programs.
SYNOPSIS
fljdb [ options ] [ class ] [ arguments ]
fl.fi
options
Command−line options, as specified below.
class
Name of the class to begin debugging.
arguments
Arguments passed to the main() method of class.
DESCRIPTION
The Java Debugger, jdb, is a simple command−line debugger for Java classes. It is a demonstration of the Java Platform Debugger Architecture @ .fi http://java.sun.com/javase/6/docs/technotes/guides/jpda/index.html that provides inspection and debugging of a local or remote Java Virtual Machine.
Starting a jdb Session There are many ways to start a jdb session. The most frequently used way is to have jdb launch a new Java Virtual Machine (VM) with the main class of the application to be debugged. This is done by substituting the command jdb for java in the command line. For example, if your application's main class is MyClass, you use the following command to debug it under JDB:
fl % jdb MyClass
flWhen started this way, jdb invokes a second Java VM with any specified parameters, loads the specified class, and stops the VM before executing that class's first instruction. Another way to use jdb is by attaching it to a Java VM that is already running. Syntax for Starting a VM to which jdb will attach when the VM is running is as follows. This loads in−process debugging libraries and specifies the kind of connection to be made.
fl−agentlib:jdwp=transport=dt_socket,server=y,suspend=n
flFor example, the following command will run the MyClass application, and allow jdb to connect to it at a later time.
fl % java −agentlib:jdwp=transport=dt_socket,address=8000,server=y,suspend=n MyClass
flYou can then attach jdb to the VM with the following commmand:
fl % jdb −attach 8000
flNote that "MyClass" is not specified in the jdb command line in this case because jdb is connecting to an existing VM instead of launching a new one. There are many other ways to connect the debugger to a VM, and all of them are supported by jdb. The Java Platform Debugger Architecture has additional documentation @ .fi http://java.sun.com/javase/6/docs/technotes/guides/jpda/conninv.html on these connection options. For information on starting a J2SE 1.4.2 or early VM for use with jdb see 1.4.2 documentation @ .fi http://java.sun.com/j2se/1.4.2/docs/technotes/guides/jpda/conninv.html
Basic jdb Commands The following is a list of the basic jdb commands. The Java debugger supports other commands which you can list using jdb's help command. help, or ? The most important jdb command, help displays the list of recognized commands with a brief description. run After starting jdb, and setting any necessary breakpoints, you can use this command to start the execution the debugged application. This command is available only when jdb launches the debugged application (as opposed to attaching to an existing VM). cont Continues execution of the debugged application after a breakpoint, exception, or step. print 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 below for getting more information about an object. NOTE: To display local variables, the containing class must have been compiled with the javac −g option. print supports many simple Java expressions including those with method invocations, for example: * print MyClass.myStaticField * print myObj.myInstanceField * print i + j + k (i, j, k are primities and either fields or local variables) * print myObj.myMethod() (if myMethod returns a non−null) * print new java.lang.String("Hello").length() dump For primitive values, this command is identical to print. For objects, it prints the current value of each field defined in the object. Static and instance fields are included. The dump command supports the same set of expressions as the print command. threads List the threads that are currently running. For each thread, its name and current status are printed, as well as an index that can be used for other commands, for example:
fl4. (java.lang.Thread)0x1 main running
flIn this example, the thread index is 4, the thread is an instance of java.lang.Thread, the thread name is "main", and it is currently running, thread Select a thread to be the current thread. Many jdb commands are based on the setting of the current thread. The thread is specified with the thread index described in the threads command above. where where with no arguments dumps the stack of the current thread. where all dumps the stack of all threads in the current thread group. where threadindex dumps the stack of the specified thread. If the current thread is suspended (either through an event such as a breakpoint or through the suspend command), local variables and fields can be displayed with the print and dump commands. The up and down commands select which stack frame is current.
Breakpoints Breakpoints can be set in jdb at line numbers or at the first instruction of a method, for example: * stop at MyClass:22 (sets a breakpoint at the first instruction for line 22 of the source file containing MyClass) * stop in java.lang.String.length (sets a breakpoint at the beginnig of the method java.lang.String.length) * stop in MyClass.<init> (<init> identifies the MyClass constructor) * stop in MyClass.<clinit> (<clinit> identifies the static initialization code for MyClass) If a method is overloaded, you must also specify its argument types so that the proper method can be selected for a breakpoint. For example, "MyClass.myMethod(int,java.lang.String)", or "MyClass.myMethod()". The clear command removes breakpoints using a syntax as in "clear MyClass:45". Using the clear or command with no argument displays a list of all breakpoints currently set. The cont command continues execution.
Stepping The step commands advances execution to the next line whether it is in the current stack frame or a called method. The next command advances execution to the next line in the current stack frame.
Exceptions When an exception occurs for which there isn't a catch statement anywhere in the throwing thread's call stack, the VM normally prints an exception trace and exits. When running under jdb, however, control returns to jdb at the offending throw. You can then use jdb to diagnose the cause of the exception. Use the catch command to cause the debugged application to stop at other thrown exceptions, for example: "catch java.io.FileNotFoundException" or "catch mypackage.BigTroubleException. Any exception which is an instance of the specifield class (or of a subclass) will stop the application at the point where it is thrown. The ignore command negates the effect of a previous catch command. NOTE: The ignore command does not cause the debugged VM to ignore specific exceptions, only the debugger.
Command Line OptionsWhen you use jdb in place of the Java application launcher on the command line, jdb accepts many of the same options as the java command, including −D, −classpath, and −X<option>. The following additional options are accepted by jdb: −help Displays a help message. −sourcepath <dir1:dir2:...> Uses the given path in searching for source files in the specified path. If this option is not specified, the default path of "." is used. −attach <address> Attaches the debugger to previously running VM using the default connection mechanism. −listen <address> Waits for a running VM to connect at the specified address using standard connector. −listenany Waits for a running VM to connect at any available address using standard connector. −launch Launches the debugged application immediately upon startup of jdb. This option removes the need for using the run command. The debuged 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 cont to continue execution. −listconnectors List the connectors available in this VM −connect <connector−name>:<name1>=<value1>,... Connects to target VM using named connector with listed argument values. −dbgtrace [flags] Prints info for debugging jdb. −tclient Runs the application in the Java HotSpot(tm) VM (Client). −tserver Runs the application in the Java HotSpot(tm) VM (Server). −Joption Pass option to the Java virtual machine used to run jdb. (Options for the application Java virtual machine are passed to the run command.) For example, −J−Xms48m sets the startup memory to 48 megabytes. Other options are supported for alternate mechanisms for connecting the debugger and the VM it is to debug. The Java Platform Debugger Architecture has additional documentation @ .fi http://java.sun.com/javase/6/docs/technotes/guides/jpda/conninv.html on these connection alternatives.
Options Forwarded to Debuggee Process −v −verbose[:class|gc|jni] Turns on verbose mode. −D<name>=<value> Sets a system property. −classpath <directories separated by ":"> Lists directories in which to look for classes. −X<option> Non−standard target VM option
SEE ALSOjavac, java, javah, javap, javadoc. 0
Johanes Gumabo
Data Size : 42,958 byte
man-jdb-java-1.6.0-openjdk.1Build : 2024-12-05, 20:55 :
Visitor Screen : x
Visitor Counter ( page / site ) : 3 / 168,247
Visitor ID : :
Visitor IP : 18.226.165.234 :
Visitor Provider : AMAZON-02 :
Provider Position ( lat x lon ) : 39.962500 x -83.006100 : x
Provider Accuracy Radius ( km ) : 1000 :
Provider City : Columbus :
Provider Province : Ohio , : ,
Provider Country : United States :
Provider Continent : North America :
Visitor Recorder : Version :
Visitor Recorder : Library :
Online Linux Manual Page : Version : Online Linux Manual Page - Fedora.40 - march=x86-64 - mtune=generic - 24.12.05
Online Linux Manual Page : Library : lib_c - 24.10.03 - march=x86-64 - mtune=generic - Fedora.40
Online Linux Manual Page : Library : lib_m - 24.10.03 - march=x86-64 - mtune=generic - Fedora.40
Data Base : Version : Online Linux Manual Page Database - 24.04.13 - march=x86-64 - mtune=generic - fedora-38
Data Base : Library : lib_c - 23.02.07 - march=x86-64 - mtune=generic - fedora.36
Very long time ago, I have the best tutor, Wenzel Svojanovsky . If someone knows the email address of Wenzel Svojanovsky , please send an email to johanes_gumabo@yahoo.co.id .
If error, please print screen and send to johanes_gumabo@yahoo.co.id
Under development. Support me via PayPal.
ERROR : Need New Coding : (parse_manual_page_|249|jdb-java-1.6.0-openjdk.1|1|'"|.'" t
) (parse_manual_page_|249|jdb-java-1.6.0-openjdk.1|2|"|."
) (parse_manual_page_|249|jdb-java-1.6.0-openjdk.1|3|"|." Copyright 2000-2006 Sun Microsystems, Inc. All Rights Reserved.
) (parse_manual_page_|249|jdb-java-1.6.0-openjdk.1|4|"|." DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
) (parse_manual_page_|249|jdb-java-1.6.0-openjdk.1|5|"|."
) (parse_manual_page_|249|jdb-java-1.6.0-openjdk.1|6|"|." This code is free software; you can redistribute it and/or modify it
) (parse_manual_page_|249|jdb-java-1.6.0-openjdk.1|7|"|." under the terms of the GNU General Public License version 2 only, as
) (parse_manual_page_|249|jdb-java-1.6.0-openjdk.1|8|"|." published by the Free Software Foundation.
) (parse_manual_page_|249|jdb-java-1.6.0-openjdk.1|9|"|."
) (parse_manual_page_|249|jdb-java-1.6.0-openjdk.1|10|"|." This code is distributed in the hope that it will be useful, but WITHOUT
) (parse_manual_page_|249|jdb-java-1.6.0-openjdk.1|11|"|." ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
) (parse_manual_page_|249|jdb-java-1.6.0-openjdk.1|12|"|." FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
) (parse_manual_page_|249|jdb-java-1.6.0-openjdk.1|13|"|." version 2 for more details (a copy is included in the LICENSE file that
) (parse_manual_page_|249|jdb-java-1.6.0-openjdk.1|14|"|." accompanied this code).
) (parse_manual_page_|249|jdb-java-1.6.0-openjdk.1|15|"|."
) (parse_manual_page_|249|jdb-java-1.6.0-openjdk.1|16|"|." You should have received a copy of the GNU General Public License version
) (parse_manual_page_|249|jdb-java-1.6.0-openjdk.1|17|"|." 2 along with this work; if not, write to the Free Software Foundation,
) (parse_manual_page_|249|jdb-java-1.6.0-openjdk.1|18|"|." Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
) (parse_manual_page_|249|jdb-java-1.6.0-openjdk.1|19|"|."
) (parse_manual_page_|249|jdb-java-1.6.0-openjdk.1|20|"|." Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
) (parse_manual_page_|249|jdb-java-1.6.0-openjdk.1|21|"|." or visit www.oracle.com if you need additional information or have any
) (parse_manual_page_|249|jdb-java-1.6.0-openjdk.1|22|"|." questions.
) (parse_manual_page_|249|jdb-java-1.6.0-openjdk.1|23|"|."
) (parse_manual_page_|249|jdb-java-1.6.0-openjdk.1|24|"|." `
) (parse_manual_page_|249|jdb-java-1.6.0-openjdk.1|26|"|." Generated by html2roff
) (rof_fi|19|jdb-java-1.6.0-openjdk.1|71|1|.fi
) (rof_fi|19|jdb-java-1.6.0-openjdk.1|137|1|.fi
) (rof_fi|19|jdb-java-1.6.0-openjdk.1|141|1|.fi
) (rof_fi|19|jdb-java-1.6.0-openjdk.1|323|1|.fi
)