1 <?xml version="1.0" encoding="utf-8"?>
3 <!DOCTYPE book PUBLIC "-//OASIS//DTD DocBk XML V4.4CR2//EN"
4 "file:///c:/home/xae-dev/xae/doctypes/docbook/docbookx.dtd" []>
7 <?xml-stylesheet href="file:///c:/home/jde-dev/jde/doc/src/styles/html/jdebook.xsl" type="text/xsl" ?>
11 <title>Debugging with jdb</title>
18 Revised for JDEE <productnumber>2.3.3</productnumber>
30 <holder>Paul Kinnucan</holder>
36 <title><anchor id="Intro"/>Debugger Setup</title>
38 <para>You should perform the following steps before attempting to use jdb.</para>
43 <para>Set the configuration variable
44 <varname>jde-debugger</varname> to <option>jdb</option> if
45 you are using version 1.3 (or later) of the Windows or
46 Solaris versions of the JDK or version 1.2.2 (or later) of
47 the Linux version of the JDK. Set
48 <varname>jde-debugger</varname> to <option>oldjdb</option>
49 if you are using older versions of the JDK.</para>
55 Use <varname>jde-sourcepath</varname> to specify the paths
56 of any source code that you expect to visit while
57 debugging your application (see <ulink
58 url="#SettingSourcePath">
59 Setting the Source Path</ulink>). If you suspect that a
60 problem is occurring in the Java API, you should include
61 the API source files in your source path.
68 Set <varname>jde-compile-option-debug</varname> on
70 <ulink url="../jde-ug/jde-ug-content.html#CompilingJavaPrograms">Compiling
71 Java Programs</ulink>). This causes the compiler to insert
72 information needed by the debugger into your
73 application's class files.
78 <para>Specify the app's main class either by setting the
79 <varname>jde-run-application-class</varname> variable or by starting the
80 debugger from the buffer that contains the source file for
90 <title><anchor id="RunningDebugger"/>Running the Debugger</title>
94 <title><anchor id="StartingDebugger"/>Starting the Debugger</title>
96 <para>To debug a program with <filename>jdb</filename>,
97 first select a buffer containing the source of the program you
98 want to debug (or a source buffer containing the program's
99 main class if you have not set
100 <varname>jde-run-application-class</varname>). Then execute
101 the JDEE's <command>jde-debug</command> command. You can execute
109 <guimenu>JDE</guimenu>
110 <guimenuitem>Debug App</guimenuitem></menuchoice>
116 Entering the key combination
120 </keycombo> <keycombo>
122 <keycap>v</keycap></keycombo> <keycombo>
124 <keycap>d</keycap></keycombo>
129 <para>Entering <keycombo>
131 <keycap>x</keycap></keycombo> <command>jde-debug</command></para>
136 <para>The JDEE launches jdb, passing to it the name of the main
137 class of the program in the current source buffer and any
138 debug options that you have specified via the JDEE's debugger
139 option variables (see <ulink
140 url="#SettingDebugOptions">Setting Debug Options</ulink>.
141 jdb in turn launches a virtual machine to run the debuggee
142 program and stops the virtual machine before the main method
143 of the program's main class. Meanwhile the JDEE splits the
144 source window into two windows.
150 <imagedata fileref="images/debug1.gif"/>
156 The upper window shows the source buffer. The menu bar
157 of the source buffer displays a menu (<guimenu>Jdb</guimenu>)
158 of debug commands. The lower window shows the debugger
162 <para>At this point, you can set breakpoints, run to a breakpoint that
163 you set before you started the debugger, or step into the main method
164 of your program.</para>
169 <title><anchor id="SettingDebugOptions"/>Setting Debug Options</title>
171 <para>The <command>jde-jdb</command> command (selected by
173 <guimenu>JDE</guimenu>
174 <guimenuitem>Debug App</guimenuitem></menuchoice> when jdb
175 is the debugger for the current project) can optionally pass
176 command-line arguments that specify various debug options to
177 jdb when starting jdb. The JDEE provides two ways to specify
178 these options: via customization variables or in the
179 minibuffer when you run the <command>jde-jdb</command>
182 <para>The <command>jde-jdb</command> command passes any
183 options that you specify via customization variables to jdb.
184 In addition, if you set the customization variable
185 <varname>jde-db-read-vm-args</varname> to a non-nil value,
186 the <command>jde-jdb</command> command prompts you to enter
187 debugger options in the minibuffer. It appends the options
188 that you enter to the options specified via customization
189 variables. The JDEE saves the arguments that you enter in a
190 minibuffer history list. You can recall previously entered
191 options by pressing the up or down arrows on your keyboard.
198 <title><anchor id="SettingAppArguments"/>Setting App Arguments</title>
200 <para>You can use the customization variable
201 <varname>jde-db-option-application-args</varname> to specify
202 arguments to be passed to the application launched by jdb.
203 The <command>jde-jdb</command> command inserts the specified
204 arguments on the command-line that it constructs to run
207 <para>In addition, if you set the customization variable
208 <varname>jde-db-read-app-args</varname> to a
209 non-<option>nil</option> value, the
210 <command>jde-jdb</command> command prompts you to enter the
211 application arguments in the minibuffer. It appends the
212 options that you enter to the arguments specified via
213 <varname>jde-db-option-application-args</varname>. The JDEE
214 saves the arguments that you enter in a minibuffer history
215 list. You can recall previously entered options by pressing
216 the up or down arrows on your keyboard. </para>
225 <title><anchor id="EnteringCommands"/>Entering Debug Commands</title>
227 <para>The JDE lets you enter commands from either the current source
228 buffer or from the debugger command-line interaction buffer.
229 You can enter all debugger commands from the debugger
230 buffer. You can enter only a subset of debugger commands
231 from the current source buffer. </para>
233 <para> To enter a debugger command
234 from the current source buffer, select the command from the
235 jdb menu or type the shortcut key for the command. The <guimenu>Jdb</guimenu>
236 menu lists the shortcut keys
237 for debugger commands. </para>
240 <para>To enter a command in the debugger interaction window, type the
241 command at the debugger prompt and press the <keycap>Enter</keycap>
242 key. To see a list of debugger commands, enter the command
243 <command>help</command>.
250 <title><anchor id="SteppingProgram"/>Stepping Through a Program</title>
253 Jdb provides a set of command-line commands that advance a
254 program to the next line or the next breakpoint. The JDEE's
255 jdb interface provides Emacs commands that invoke the jdb's
256 step commands from a source buffer and move a debug cursor to
257 the next line to be executed in the source buffer. If you
258 prefer, you can enter jdb's step commands directly in the jdb
264 <title><anchor id="StepCommands"/>Step Commands</title>
266 <para> The following table lists the jdb step commands
267 supported by the JDEE.
271 <title>Step Commands</title>
275 <entry>Jdb Menu Item</entry>
276 <entry>Emacs Command</entry>
277 <entry>jdb Command</entry>
278 <entry>Description</entry>
283 <entry>Step Over</entry>
284 <entry>jde-bug-step-over</entry>
286 <entry><para>Advance to the next line in the current
287 method, stepping over any lines that invoke other
288 methods.</para></entry>
291 <entry>Step Into</entry>
292 <entry>jde-debug-step-into</entry>
294 <entry><para>Advance to the next line in the
295 program.</para></entry>
298 <entry>Step Out</entry>
299 <entry>jde-debug-step-out</entry>
300 <entry>step up</entry>
301 <entry><para>Advance to the next line in the method
302 that invoked the current method.</para></entry>
305 <entry>Continue</entry>
306 <entry>jde-debug-cont</entry>
308 <entry><para>Advance to the next breakpoint or to the
309 end of the program, whichever comes
310 first.</para></entry>
320 <title><anchor id="DebugCursor"/>Debug Cursor</title>
322 <para>The JDEE uses an arrow, called the debug cursor, to
323 indicate the next line to be executed as the result of a
324 step or continue command. The debug cursor appears in the
325 left gutter of the source window containing the next line to
331 <imagedata fileref="images/debug_cursor.gif"/>
336 <para>If the step or continue command advances the
337 program to a line that is not displayed in the current
338 source window, the JDEE opens the source file containing the
339 line, if necessary, and displays the source buffer in the
340 current source window, with the window scrolled to show the
341 line at which the program has halted.</para>
344 <para>A blank source buffer indicates that the debugger
345 cannot find the source file into which you have stepped.
346 You should check your source path setting (see <ulink
347 url="#SettingSourcePath">Setting the Source
348 Path</ulink>) to ensure that it includes all source
349 files in the execution path of your program.
361 <title><anchor id="SettingBreakpoints"/>Setting Breakpoints</title>
364 <para>To set a breakpoint on any executable line in the current
365 source buffer, click on the line and select <menuchoice>
366 <guimenu>Jdb</guimenu>
367 <guimenuitem>Set Breakpoint</guimenuitem></menuchoice>
370 <keycap>c</keycap></keycombo><keycombo>
372 <keycap>a</keycap></keycombo>
375 <keycap>b</keycap></keycombo>). The JDEE highlights the
376 current line to indicate that a breakpoint is to be set at that
382 <imagedata fileref="images/breakpoint.gif"/>
390 running, the JDEE issues a command to the debugger to set a
391 breakpoint at the highlighted line. If not, the JDEE issues the
392 breakpoint command as soon as you start the debugger. If the
393 class in which the breakpoint is to be set is currently in memory
394 and the breakpoint is valid, the debugger sets the breakpoint.
395 If the class in which the breakpoint is set is not in memory,
396 the debugger puts it on a list of pending breakpoints. If the
397 class is subsequently loades, the debugger sets the breakpoint
403 <title><anchor id="BreakpointColors"/>Breakpoint Colors</title>
407 The color of a breakpoint highlight indicates the status of the breakpoint
412 <title>Breakpoint Colors</title>
417 <entry>Description</entry>
423 <entry>The JDEE has not yet issued a command to the
424 debugger to set the breakpoint.</entry>
427 <entry>Yellow</entry>
428 <entry>The breakpoint is pending loading of the class in which it
429 is to be set.</entry>
433 <entry>The breakpoint has been set.</entry>
443 <title><anchor id="ClearingBreakpoints"/>Clearing
446 To clear a breakpoint from a line in the current buffer, click
447 on the line and select <menuchoice>
448 <guimenu>Jdb</guimenu>
449 <guimenuitem>Toggle Breakpoint</guimenuitem></menuchoice>
452 <keycap>c</keycap></keycombo>
455 <keycap>a</keycap></keycombo>
458 <keycap>b</keycap></keycombo>).
461 <para>To clear all breakpoints set in the current session,
462 select <menuchoice><guimenu>Jdb</guimenu> <guimenuitem>Clear
463 Breakpoints</guimenuitem></menuchoice>.
467 <para>You can also set and clear breakpoints by entering jdb
468 breakpoint commands in the jdb interaction buffer. See the
469 jdb documentation for information on using the jdb
470 breakpoint commands.</para>
479 <title><anchor id="SettingSourcePath"/>Setting the Source Path</title>
481 <para>The <varname>jde-sourcepath</varname> variable specifies the
482 directories the JDEE should search for source for classes
483 visited by the debugger as you step through your program.
487 <para>To set this variable, enter <command>M-x customize-variable jde-sourcepath</command>.
488 The customization buffer for jde-sourcepath appears. The buffer shows the current
489 source path as a list of paths.</para>
494 <imagedata fileref="images/debug2.gif"/>
499 <para>To add a path, click the <guibutton>INS</guibutton> button
500 corresponding to the position in the list and enter the path in
501 the resulting edit field. To delete a path, click the <guibutton>DEL</guibutton> button
502 corresponding to the path. You can use environment variables in paths and
503 use dot notation to specify paths relative to the project file for the
504 project to which this sourcepath applies. When you are done editing the buffer,
505 press the <guibutton>State</guibutton> button to set the
508 <para>To avoid having to specify the sourcepath every time you
509 start a session, save the setting of
510 <varname>jde-db-sourcepath</varname> in your
511 <filename>prj.el</filename> file (see <ulink
512 url="../jde-ug/jde-ug-content.html#SavingProjSettings">Saving
513 Project Settings</ulink>) To save the setting in your project
516 <guimenu>JDE</guimenu>
517 <guimenuitem>Project</guimenuitem><guimenuitem>Project File</guimenuitem>
518 <guimenuitem>Save</guimenuitem></menuchoice> (<keycombo>
534 You must specify the paths of the top-level directories of any
535 source code that you might visit while debugging your
536 application. The source code directory structure must mirror
537 your application's package structure. For example, suppose that your
538 application includes a set of classes packaged in the
539 <filename>myapp</filename> directory. Then, the source for those classes
540 must be reside in a directory named <filename>myapp</filename> and you must
541 specify the path of <filename>myapp</filename>'s parent directory.
544 <para>If you want to step through the JDK source code,
545 select the source code install option when you install the JDK
546 and set the <varname>jde-sourcepath</varname> variable
547 to the top-level directory containing the source code.
548 The JDE will use the JDK's package structure to find the
549 source code in the subdirectories. </para>
557 <title><anchor id="DisplayingVariables"/>Displaying Variables</title>
559 <para>This section shows you how to display the values of variables
560 (or expressions).</para>
564 <title><anchor id="DisplayingExpressions"/>Displaying
567 <para>When the debuggee program is stopped, the debugger lets
568 you display the value of any valid Java expression composed of
569 variables currently in scope. For example, to display the
570 value of a local, in-scope variable whose source is displayed
571 in a Java source buffer, put the point on the variable and
574 <guimenu>Jdb</guimenu>
575 <guimenuitem>Display</guimenuitem>
576 <guimenuitem>Expression</guimenuitem>
577 </menuchoice>. The JDEE prompts you to enter an expression to be
578 evaluated and displayed in the minibuffer.</para>
583 <imagedata fileref="images/display_var1.gif"/>
589 <para> The default expression is the variable at point in the
590 source buffer. Edit the displayed expression and press
591 <keycap>Enter</keycap>. The JDEE issues a command to the
592 debugger to display the variable in the jdb buffer.</para>
597 <imagedata fileref="images/display_var2.gif"/>
605 <title><anchor id="DisplayingObjects"/>Displaying
607 <para>To display the values of the fields of an object
608 referenced by an in-scope variable in the current source
611 <guimenu>Jdb</guimenu>
612 <guimenuitem>Display</guimenuitem>
613 <guimenuitem>Object</guimenuitem>
614 </menuchoice>. The JDEE prompts you to enter the name of the
615 variable in the minibuffer. The default is the variable at
616 point in the source buffer. Press <keycap>Enter</keycap>. The
617 JDEE issues a <command>dump</command> command to the debugger
618 to display the field values of the object referenced by the
619 variable you entered.</para>
624 <imagedata fileref="images/display_obj.gif"/>
633 <title><anchor id="DisplayingLocals"/>Displaying Locals
635 <para>To display the values of all in-scope local variables,
636 including the values of the arguments of the method in which
637 the program is halted, select
639 <guimenu>Jdb</guimenu>
640 <guimenuitem>Display</guimenuitem>
641 <guimenuitem>Locals</guimenuitem>
642 </menuchoice>. The JDEE issues a <command>locals</command>
643 command to the debugger to display the local variable
649 <imagedata fileref="images/display_locals.gif"/>
657 <title><anchor id="SettingVariables"/>Setting Variables</title>
659 <para>Jdb allows you to change the values of variables that are
660 in scope. To change the value of a variable via the JDEE's jdb
666 <para>Position point on the variable you want to change.</para>
670 <para>Select <menuchoice>
671 <guimenu>Jdb</guimenu>
672 <guimenuitem>Set Variable</guimenuitem>
675 <para>The JDEE prompts you to enter a left expression that
676 represents the variable whose value you want to change. The
677 default is the variable at point in the source buffer.
683 <imagedata fileref="images/set_var1.gif"/>
689 <para>Edit the expression if necessary. For example, to set
690 the value of an array element at point, edit the
691 expression to include the index of the element.</para>
697 <para>Press <keycap>Enter</keycap>.</para>
698 <para>The JDEE prompts you to enter the new value of the
704 <imagedata fileref="images/set_var2.gif"/>
711 <para>Enter the new value at the prompt in the minibuffer.</para>
716 <imagedata fileref="images/set_var3.gif"/>
724 <para>Press <keycap>Enter</keycap>.</para>
725 <para>The JDEE issues a <command>set</command> command to the
726 debugger to set the specified variable to the new
732 <imagedata fileref="images/set_var4.gif"/>
745 <title><anchor id="DebugExternalProcesses"/>Debugging External Processes</title>
747 <para>Normally jdb launches the application that it debugs.
748 However, you can use jdb to debug processes that are not
749 launched by jdb itself. This is useful, for example, if you need
750 to debug a process running on a remote computer or a Java
751 process launched by a nonJava process.</para>
753 <para>Jdb provides two
754 modes for debugging external processes: attach mode and listen
755 mode. When started in attach mode, jdb connects itself to the
756 external process. When started in listen mode, jdb waits for an
757 external process to connect itself to jdb. Each mode has
758 advantages. Attach mode allows you to debug an external process
759 anytime after it has started. Listen mode allows you to debug
760 the startup of a Java process launched by a nonJava process.</para>
763 The following sections explain how to use the JDEE's jdb
764 interface to run jdb in attach and listen mode.</para>
767 <title><anchor id="AttachingProcesses"/>Attaching Processes</title>
769 <para>To attach jdb to an external process, you must ensure that the
770 external process is started in debug server mode. You must then
771 start jdb in attach mode.</para>
774 <title><anchor id="DebugServerMode"/>Starting the External
775 Process in Debug Server Mode</title>
777 <para>To start an external process in debug server mode, you
778 must start the vm that runs the process with the following
779 command-line options:</para>
783 <para><literal>-Xdebug</literal></para>
788 <literal>-Xrunjdwp:transport=<keycap>TRANSPORT</keycap>,address=<keycap>ADDRESS</keycap>,server=y,suspend=<keycap>SUSPEND</keycap></literal>
793 <para><literal><keycap>TRANSPORT</keycap></literal> is
794 the type of communications channel between jdb and
795 the debuggee process, either
796 <literal>dt_socket</literal> (socket) or
797 <literal>dt_shmem</literal> (shared memory, valid
798 only for Windows systems)</para>
802 <para><literal><keycap>ADDRESS</keycap></literal> is
803 the address of the socket port or shared memory area
804 used by the debuggee process to listen for a jdb
809 <para><literal><keycap>SUSPEND</keycap></literal> is
810 either <literal>y</literal> (suspend the debuggee
811 process at startup, i.e., to wait for jdb to start,
812 a useful option when you need to debug an
813 application's startup code) or <literal>n</literal>
814 (do not suspend the debuggee process)</para>
822 <title>Specifying Socket Transport</title>
823 <para><literal>-Xdebug
824 -Xrunjdwp:transport=dt_socket,address=4444,server=y,suspend=n</literal></para>
828 <title>Specifying Shared Memory Transport (MS Windows only)</title>
829 <para><literal>-Xdebug
830 -Xrunjdwp:transport=dt_shmem,address=javadebug,server=y,suspend=n</literal></para>
834 <para>The JDEE customization variable, <varname>jde-run-option-debug</varname>, causes
835 the JDEE to generate these arguments automatically when launching a vm to run a Java
836 application. Thus, if you plan to launch the debuggee process from the JDEE, you
837 should set this variable to the desired options.</para>
841 <title><anchor id="AttachMode"/>Starting jdb in Attach
844 <para>To attach jdb to an existing process via a socket,
846 <guimenu>Jdb</guimenu>
847 <guimenuitem>External Process</guimenuitem>
848 <guimenuitem>Attach Via Socket</guimenuitem>
849 </menuchoice> from the Emacs menu bar. By default,
850 the JDEE uses the socket address specified by
851 the customization variable <varname>jde-db-option-connect-socket</varname>.
852 If you set this variable to Prompt (nil), the JDEE
853 prompts you to enter a socket address in the minibuffer.
857 <para>The default socket address specified by
858 <varname>jde-db-option-connect-socket</varname>
859 is the same as the default socket address specified
860 by <varname>jde-run-option-debug</varname>. Thus, if you
861 want to attach jdb to a process started by the JDEE, the
862 only variable you have to set is
863 <varname>jde-run-option-debug</varname> (to run
864 the debuggee process in socket attach mode).</para>
868 <para>To attach jdb to an existing process via a shared memory
869 connection (Windows platforms only),
871 <guimenu>Jdb</guimenu>
872 <guimenuitem>External Process</guimenuitem>
873 <guimenuitem>Attach Via Shared Memory</guimenuitem>
874 </menuchoice> from the Emacs menu bar. By default,
875 the JDEE uses the shared memory transport name specified by
876 the customization variable
877 <varname>jde-db-option-connect-shared-memory-name</varname>.
878 If you set this variable to Prompt (nil), the JDEE
879 prompts you to enter a shared-memory name in the minibuffer.
883 <para>The default shared memory name specified by
884 <varname>jde-db-option-connect-shared-memory-name</varname>
885 is the same as the default shared memory name specified
886 by <varname>jde-run-option-debug</varname>. Thus, if you
887 want to attach jdb to a process started by the JDEE, the
888 only variable you have to set is
889 <varname>jde-run-option-debug</varname> (to run
890 the debuggee process in shared memory attach mode).</para>
898 <title><anchor id="ListeningForProcesses"/>Listening for Processes</title>
900 <para>To connect an external process to a jdb instance running in listener
905 <para>Start jdb in listener mode (see <ulink url="#ListenMode">Starting
906 jdb in Listen Mode</ulink>)</para>
909 <para>Start the debuggee process in debug client
910 mode(see <ulink url="#DebugClientMode">Starting
911 the External Process in Debug Client Mode</ulink>)</para>
916 <title><anchor id="ListenMode"/>Starting jdb in Listen Mode</title>
917 <para>To start jdb in listen mode, select <menuchoice>
918 <guimenu>Jdb</guimenu>
919 <guimenuitem>External Process</guimenuitem>
920 <guimenuitem>Listen For</guimenuitem>
921 </menuchoice> from the Emacs menu bar. By default, the
922 JDEE prompts you to enter the address of the process to
923 be debugged in the minibuffer. The JDEE customization variable
924 jde-db-option-listen-address allows you to specify a default
925 debuggee address. If you set this variable, the JDEE does not
926 prompt you to enter an address.
929 <para>To start jdb listening for existing process via a socket,
931 <guimenu>Jdb</guimenu>
932 <guimenuitem>External Process</guimenuitem>
933 <guimenuitem>Listen Via Socket</guimenuitem>
934 </menuchoice> from the Emacs menu bar. By default,
935 the JDEE uses the socket address specified by
936 the customization variable <varname>jde-db-option-connect-socket</varname>.
937 If you set this variable to Prompt (nil), the JDEE
938 prompts you to enter a socket address in the minibuffer.
942 <para>The default socket address specified by
943 <varname>jde-db-option-connect-socket</varname>
944 is the same as the default socket address specified
945 by <varname>jde-run-option-debug</varname>. Thus, if you
946 want jdb to listen for a process started by the JDEE, the
947 only variable you have to set is
948 <varname>jde-run-option-debug</varname>, i.e., to run
949 the debuggee process in socket listen (client) mode.</para>
953 <para>To start jdb listening for a process via a shared memory
954 connection (Windows platforms only),
956 <guimenu>Jdb</guimenu>
957 <guimenuitem>External Process</guimenuitem>
958 <guimenuitem>Listen Via Shared Memory</guimenuitem>
959 </menuchoice> from the Emacs menu bar. By default,
960 the JDEE uses the shared memory transport name specified by
961 the customization variable
962 <varname>jde-db-option-connect-shared-memory-name</varname>.
963 If you set this variable to Prompt (nil), the JDEE
964 prompts you to enter a shared-memory name in the minibuffer.
968 <para>The default shared memory name specified by
969 <varname>jde-db-option-connect-shared-memory-name</varname>
970 is the same as the default shared memory name specified
971 by <varname>jde-run-option-debug</varname>. Thus, if you
972 want jdb to listen for a process started by the JDEE, the
973 only variable you have to set is
974 <varname>jde-run-option-debug</varname>, i.e., to run
975 the debuggee process in shared memory listen (client) mode.</para>
982 <title><anchor id="DebugClientMode"/>Starting the External
983 Process in Debug Client Mode</title>
985 <para>To start an external process in debug client mode, you
986 must start the vm that runs the process with the following
987 command-line options:</para>
991 <para><literal>-Xdebug</literal></para>
996 <literal>-Xrunjdwp:transport=<keycap>TRANSPORT</keycap>,address=<keycap>ADDRESS</keycap>,server=n,suspend=<keycap>SUSPEND</keycap></literal>
1001 <para><literal><keycap>TRANSPORT</keycap></literal> is
1002 the type of communications channel between jdb and
1003 the debuggee process, either
1004 <literal>dt_socket</literal> (socket) or
1005 <literal>dt_shmem</literal> (shared memory, valid
1006 only for Windows systems)</para>
1010 <para><literal><keycap>ADDRESS</keycap></literal> is
1011 the address of the socket port or shared memory area
1012 used by jdb to listen for a debuggee process
1017 <para><literal><keycap>SUSPEND</keycap></literal> is
1018 either <literal>y</literal> (suspend the debuggee
1019 process when the connection occurs,
1020 a useful option when you need to debug an
1021 application's startup code) or <literal>n</literal>
1022 (do not suspend the debuggee process)</para>
1030 <title>Specifying Socket Transport</title>
1031 <para><literal>-Xdebug
1032 -Xrunjdwp:transport=dt_socket,address=4444,server=n,suspend=n</literal></para>
1036 <title>Specifying Shared Memory Transport (MS Windows only)</title>
1037 <para><literal>-Xdebug
1038 -Xrunjdwp:transport=dt_shmem,address=javadebug,server=n,suspend=n</literal></para>
1042 <para>The JDEE customization variable, <varname>jde-run-option-debug</varname>, causes
1043 the JDEE to generate these arguments automatically when launching a vm to run a Java
1044 application. Thus, if you plan to launch the debuggee process from the JDEE, you
1045 should set this variable to the desired options.</para>
1055 <title><anchor id="DebugOptions"/>Debug Options</title>
1057 <para>The JDEE allows you to specify debug options by setting JDEE
1058 configuration variables. You can use the Emacs customization
1059 feature to set debug variables interactively. To use the
1060 customization feature, select <menuchoice>
1061 <guimenu>Project</guimenu>
1062 <guimenuitem>Options</guimenuitem>
1063 <guimenuitem>Debug</guimenuitem></menuchoice> from the
1064 <guimenu>JDE</guimenu> menu. (See <ulink
1065 url="../jde-ug/jde-ug-content.html#ConfiguringJDE">Configuring
1066 the JDEE</ulink> for more information on using the
1067 customization feature). To save the compilation settings in the
1068 project file (see <ulink
1069 url="../jde-ug/jde-ug-content.html#UsingProjectFiles">Using
1070 Project Files</ulink> for the current source buffer, select
1072 <guimenu>Project</guimenu>
1073 <guimenuitem>Project File</guimenuitem>
1074 <guimenuitem>Save</guimenuitem></menuchoice> from the
1075 <guimenu>JDE</guimenu> menu.</para>
1077 <para>The following table lists the jdb customization variables.</para>
1082 <title>Jdb Customization Variables</title>
1088 <entry>Variable</entry>
1089 <entry>Group</entry>
1090 <entry>Usage</entry>
1096 <entry valign="top"><varname>jde-debugger</varname></entry>
1097 <entry valign="top">Project</entry>
1098 <entry valign="top">Specify which debugger to use to debug the current project.</entry>
1101 <entry valign="top"><varname>jde-sourcepath</varname></entry>
1102 <entry valign="top">Project</entry>
1103 <entry valign="top">Specify location(s) of source files that
1104 can be visited while stepping through a program.</entry>
1107 <entry valign="top"><varname>jde-db-mode-hook</varname></entry>
1108 <entry valign="top">Project</entry>
1109 <entry valign="top">Customization hook for jde-db inferior
1113 <entry valign="top"><varname>jde-global-classpath</varname></entry>
1114 <entry valign="top">Project</entry>
1115 <entry valign="top">Specify class paths for compile, run,
1116 and debug commands.</entry>
1119 <entry valign="top"><varname>jde-db-read-vm-args</varname></entry>
1120 <entry valign="top">Project</entry>
1121 <entry>Specifies whether to read debugger VM arguments from
1122 the minibuffer.</entry>
1125 <entry valign="top"><varname>jde-db-read-app-args</varname></entry>
1126 <entry valign="top">Project</entry>
1127 <entry>Specifies whether to read command-line application
1128 arguments from the minibuffer.</entry>
1131 <entry valign="top"><varname>jde-db-option-classpath</varname></entry>
1132 <entry valign="top">Debug</entry>
1133 <entry valign="top">Specifies the classpath for the
1134 Java interpreter. This option overrides the
1135 jde-global-classpath option.</entry>
1138 <entry valign="top"><varname>jde-db-option-verbose</varname></entry>
1139 <entry valign="top">Debug</entry>
1140 <entry valign="top">Print messages about the running
1144 <entry valign="top"><varname>jde-db-option-properties</varname></entry>
1145 <entry valign="top">Debug</entry>
1146 <entry valign="top">Specify property values.</entry>
1149 <entry valign="top"><varname>jde-db-option-heap-size</varname></entry>
1150 <entry valign="top">Debug</entry>
1151 <entry valign="top">Specify the initial and maximum size of
1152 the interpreter heap.</entry>
1155 <entry valign="top"><varname>jde-db-option-stack-size</varname></entry>
1156 <entry valign="top">Debug</entry>
1157 <entry valign="top">Specify size of the C and Java stacks.</entry>
1160 <entry valign="top"><varname>jde-db-option-garbage-</varname>
1161 <varname>collection</varname></entry>
1162 <entry valign="top">Debug</entry>
1163 <entry valign="top">Specify garbage collection
1167 <entry valign="top"><varname>jde-db-option-java-profile</varname></entry>
1168 <entry valign="top">Debug</entry>
1169 <entry valign="top">Enable Java profiling.</entry>
1172 <entry valign="top"><varname>jde-db-option-heap-profile</varname></entry>
1173 <entry valign="top">Debug</entry>
1174 <entry valign="top">Output heap profiling data.</entry>
1177 <entry valign="top"><varname>jde-db-option-verify</varname></entry>
1178 <entry valign="top">Debug</entry>
1179 <entry valign="top">Verify classes.</entry>
1182 <entry valign="top"><varname>jde-db-option-vm-args</varname></entry>
1183 <entry valign="top">Debug</entry>
1184 <entry valign="top">Specify command-line arguments to be
1185 passed to the Java VM.</entry>
1188 <entry valign="top"><varname>jde-db-option-application-args</varname></entry>
1189 <entry valign="top">Debug</entry>
1190 <entry valign="top">Specify command-line arguments to pass
1191 to the application.</entry>
1194 <entry valign="top"><varname>jde-db-option-connect-socket</varname></entry>
1195 <entry valign="top">Debug</entry>
1196 <entry valign="top">Specify socket address of a running process
1197 to which you want to connect the debugger, using a
1198 debugger attach or listen command.</entry>
1201 <entry valign="top"><varname>jde-db-option-connect-shared-memory-name</varname></entry>
1202 <entry valign="top">Debug</entry>
1203 <entry valign="top">Specify shared memory name used by the debugger
1204 to attach or listen for debuggee processes to debug.</entry>
1207 <entry valign="top"><varname>jde-db-option-host</varname></entry>
1208 <entry valign="top">Debug</entry>
1209 <entry valign="top">Host of a remote process to which you
1210 wish to attach the debugger. This option is invalid for JDK verions
1211 greater than JDK 1.1.x.</entry>
1226 sgml-insert-missing-element-comment: nil