aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChong Yidong2008-10-31 06:16:20 +0000
committerChong Yidong2008-10-31 06:16:20 +0000
commita03334cadfd29655477a020fcc1a94d23d13c80a (patch)
tree564f89b468407384c9f80ad5392e2374e9db3a39
parentd52582c3625bb7ccb288478739273ce3287048f0 (diff)
downloademacs-a03334cadfd29655477a020fcc1a94d23d13c80a.tar.gz
emacs-a03334cadfd29655477a020fcc1a94d23d13c80a.zip
(Compilation Mode): Document
compilation-auto-jump-to-first-error. (Debuggers): Lower GUD subsections to subsubsections. (Starting GUD): Add cindex. (Lisp Interaction): Note that scratch is no longer the initial buffer.
-rw-r--r--doc/emacs/building.texi139
1 files changed, 79 insertions, 60 deletions
diff --git a/doc/emacs/building.texi b/doc/emacs/building.texi
index d2f73b28da3..8b6bfd84c78 100644
--- a/doc/emacs/building.texi
+++ b/doc/emacs/building.texi
@@ -65,7 +65,7 @@ directory.
65@vindex compile-command 65@vindex compile-command
66 The default for the compilation command is normally @samp{make -k}, 66 The default for the compilation command is normally @samp{make -k},
67which is correct most of the time for nontrivial programs. 67which is correct most of the time for nontrivial programs.
68(@xref{Top,, Make, make, GNU Make Manual}.) If you have done @kbd{M-x 68@xref{Top,, Make, make, GNU Make Manual}. If you have done @kbd{M-x
69compile} before, the default each time is the command you used the 69compile} before, the default each time is the command you used the
70previous time. @code{compile} stores this command in the variable 70previous time. @code{compile} stores this command in the variable
71@code{compile-command}, so setting that variable specifies the default 71@code{compile-command}, so setting that variable specifies the default
@@ -194,11 +194,15 @@ compilation buffer produce automatic source display.
194@end table 194@end table
195 195
196@findex compile-goto-error 196@findex compile-goto-error
197@vindex compilation-auto-jump-to-first-error
197 You can visit the source for any particular error message by moving 198 You can visit the source for any particular error message by moving
198point in the @samp{*compilation*} buffer to that error message and 199point in the @samp{*compilation*} buffer to that error message and
199typing @key{RET} (@code{compile-goto-error}). Alternatively, you can 200typing @key{RET} (@code{compile-goto-error}). Alternatively, you can
200click @kbd{Mouse-2} on the error message; you need not switch to the 201click @kbd{Mouse-2} on the error message; you need not switch to the
201@samp{*compilation*} buffer first. 202@samp{*compilation*} buffer first. If you set the variable
203@code{compilation-auto-jump-to-first-error} to a non-@code{nil} value,
204Emacs automatically jumps to the first error (if any exists) once
205compilation finishes.
202 206
203@kindex M-g M-n 207@kindex M-g M-n
204@kindex M-g n 208@kindex M-g n
@@ -442,6 +446,36 @@ Flymake, flymake, The Flymake Manual}.
442@cindex debuggers 446@cindex debuggers
443@cindex GUD library 447@cindex GUD library
444@cindex GDB 448@cindex GDB
449
450Emacs provides two separate facilities for using external symbolic
451debuggers, which are programs for testing and debugging other
452programs:
453@itemize @bullet
454@item
455The Grand Unified Debugger (GUD) provides a simple, text-based
456interface for a wide variety of symbolic debuggers, including the GNU
457Debugger (GDB), the Perl debugger, the Python debugger, and the Java
458Debugger.
459
460@item
461The GDB Graphical Interface is an Emacs package that interacts with
462GDB to turn Emacs into a graphical ``integrated development
463environment'', or IDE.
464@end itemize
465
466 In addition, Emacs contains a built-in system for debugging Emacs
467Lisp programs. @xref{Debugging,, The Lisp Debugger, elisp, the Emacs
468Lisp Reference Manual}, for information on the Emacs Lisp debugger.
469
470@menu
471* GUD:: The Grand Unified Debugger.
472* GDB Graphical Interface:: A mode that uses GDB features to implement
473 a graphical Emacs debugging environment.
474@end menu
475
476@node GUD
477@subsection GUD
478@cindex GUD library
445@cindex DBX 479@cindex DBX
446@cindex SDB 480@cindex SDB
447@cindex XDB 481@cindex XDB
@@ -450,68 +484,55 @@ Flymake, flymake, The Flymake Manual}.
450@cindex PDB 484@cindex PDB
451 485
452@c Do you believe in GUD? 486@c Do you believe in GUD?
453The GUD (Grand Unified Debugger) library provides an interface to 487The GUD (Grand Unified Debugger) library provides an Emacs interface
454various symbolic debuggers from within Emacs. We recommend the 488to a wide variety of symbolic debuggers. Unlike the GDB graphical
455debugger GDB, which is free software, but GUD can also run DBX, SDB or 489interface, which only runs GDB (@pxref{GDB Graphical Interface}), GUD
456XDB. GUD can also serve as an interface to Perl's debugging mode, the 490can also run DBX, SDB, XDB, Perl's debugging mode, the Python debugger
457Python debugger PDB, and to JDB, the Java Debugger. 491PDB, or the Java Debugger JDB.
458@xref{Debugging,, The Lisp Debugger, elisp, the Emacs Lisp Reference
459Manual}, for information on debugging Emacs Lisp programs.
460 492
461@menu 493@menu
462* Starting GUD:: How to start a debugger subprocess. 494* Starting GUD:: How to start a debugger subprocess.
463* Debugger Operation:: Connection between the debugger and source buffers. 495* Debugger Operation:: Connection between the debugger and source buffers.
464* Commands of GUD:: Key bindings for common commands. 496* Commands of GUD:: Key bindings for common commands.
465* GUD Customization:: Defining your own commands for GUD. 497* GUD Customization:: Defining your own commands for GUD.
466* GDB Graphical Interface:: An enhanced mode that uses GDB features to
467 implement a graphical debugging environment through
468 Emacs.
469@end menu 498@end menu
470 499
471@node Starting GUD 500@node Starting GUD
472@subsection Starting GUD 501@subsubsection Starting GUD
473 502
474 There are several commands for starting a debugger, each corresponding 503 There are several commands for starting a debugger under GUD, each
475to a particular debugger program. 504corresponding to a particular debugger program.
476 505
477@table @kbd 506@table @kbd
478@item M-x gdb @key{RET} @var{file} @key{RET}
479@findex gdb
480Run GDB as a subprocess of Emacs. This uses an IDE-like graphical
481interface; see @ref{GDB Graphical Interface}. Only GDB works with the
482graphical interface.
483
484@item M-x gud-gdb @key{RET} @var{file} @key{RET} 507@item M-x gud-gdb @key{RET} @var{file} @key{RET}
485@findex gud-gdb 508@findex gud-gdb
486Run GDB as a subprocess of Emacs. This command creates a buffer for 509Run GDB as a subprocess of Emacs. This command creates a buffer for
487input and output to GDB, and switches to it. If a GDB buffer already 510input and output to GDB, and switches to it. If a GDB buffer already
488exists, it just switches to that buffer. 511exists, it just switches to that buffer. (To run GDB in an IDE-like
512graphical interface instead, see @ref{GDB Graphical Interface}.)
489 513
490@item M-x dbx @key{RET} @var{file} @key{RET} 514@item M-x dbx @key{RET} @var{file} @key{RET}
491@findex dbx 515@findex dbx
492Run DBX as a subprocess of Emacs. Since Emacs does not implement a 516Run DBX as a subprocess of Emacs.
493graphical interface for DBX, communication with DBX works by typing
494commands in the GUD interaction buffer. The same is true for all
495the other supported debuggers.
496 517
497@item M-x xdb @key{RET} @var{file} @key{RET} 518@item M-x xdb @key{RET} @var{file} @key{RET}
498@findex xdb 519@findex xdb
499@vindex gud-xdb-directories 520@vindex gud-xdb-directories
500Similar, but run XDB. Use the variable 521Run XDB as a subprocess of Emacs. Use the variable
501@code{gud-xdb-directories} to specify directories to search for source 522@code{gud-xdb-directories} to specify directories to search for source
502files. 523files.
503 524
504@item M-x sdb @key{RET} @var{file} @key{RET} 525@item M-x sdb @key{RET} @var{file} @key{RET}
505@findex sdb 526@findex sdb
506Similar, but run SDB. 527Run SDB as a subprocess of Emacs.
507 528
508 Some versions of SDB do not mention source file names in their 529Some versions of SDB do not mention source file names in their
509messages. When you use them, you need to have a valid tags table 530messages. When you use them, you need to have a valid tags table
510(@pxref{Tags}) in order for GUD to find functions in the source code. 531(@pxref{Tags}) in order for GUD to find functions in the source code.
511If you have not visited a tags table or the tags table doesn't list one 532If you have not visited a tags table or the tags table doesn't list
512of the functions, you get a message saying @samp{The sdb support 533one of the functions, you get a message saying @samp{The sdb support
513requires a valid tags table to work}. If this happens, generate a valid 534requires a valid tags table to work}. If this happens, generate a
514tags table in the working directory and try again. 535valid tags table in the working directory and try again.
515 536
516@item M-x perldb @key{RET} @var{file} @key{RET} 537@item M-x perldb @key{RET} @var{file} @key{RET}
517@findex perldb 538@findex perldb
@@ -533,7 +554,7 @@ debugger supports. However, shell wildcards and variables are not
533allowed. GUD assumes that the first argument not starting with a 554allowed. GUD assumes that the first argument not starting with a
534@samp{-} is the executable file name. 555@samp{-} is the executable file name.
535 556
536@c Running a debugger on a remote host 557@cindex remote host, debugging on
537Tramp provides a facility to debug programs on remote hosts 558Tramp provides a facility to debug programs on remote hosts
538(@pxref{Running a debugger on a remote host, Running a debugger on a 559(@pxref{Running a debugger on a remote host, Running a debugger on a
539remote host,, tramp, The Tramp Manual}), whereby both the debugger and 560remote host,, tramp, The Tramp Manual}), whereby both the debugger and
@@ -544,7 +565,7 @@ GDB remote debugging feature, for example (@pxref{Remote Debugging,,
544Debugging Remote Programs, gdb, The GNU debugger}). 565Debugging Remote Programs, gdb, The GNU debugger}).
545 566
546@node Debugger Operation 567@node Debugger Operation
547@subsection Debugger Operation 568@subsubsection Debugger Operation
548 569
549@cindex fringes, and current execution line in GUD 570@cindex fringes, and current execution line in GUD
550 Generally when you run a debugger with GUD, the debugger uses an Emacs 571 Generally when you run a debugger with GUD, the debugger uses an Emacs
@@ -591,7 +612,7 @@ interface supports GUD tooltips and assures they will not cause side
591effects. 612effects.
592 613
593@node Commands of GUD 614@node Commands of GUD
594@subsection Commands of GUD 615@subsubsection Commands of GUD
595 616
596 The GUD interaction buffer uses a variant of Shell mode, so the 617 The GUD interaction buffer uses a variant of Shell mode, so the
597Emacs commands of Shell mode are available (@pxref{Shell Mode}). All 618Emacs commands of Shell mode are available (@pxref{Shell Mode}). All
@@ -748,7 +769,7 @@ enter a tab as input to the program you are debugging with GDB.
748Instead, type @kbd{C-q @key{TAB}} to enter a tab. 769Instead, type @kbd{C-q @key{TAB}} to enter a tab.
749 770
750@node GUD Customization 771@node GUD Customization
751@subsection GUD Customization 772@subsubsection GUD Customization
752 773
753@vindex gdb-mode-hook 774@vindex gdb-mode-hook
754@vindex dbx-mode-hook 775@vindex dbx-mode-hook
@@ -823,13 +844,13 @@ Fully qualified class name derived from the expression surrounding point
823@node GDB Graphical Interface 844@node GDB Graphical Interface
824@subsection GDB Graphical Interface 845@subsection GDB Graphical Interface
825 846
826 By default, the command @code{gdb} starts GDB using a graphical 847 The command @code{gdb} starts GDB in a graphical interface, using
827interface, using Emacs windows for display program state information. 848Emacs windows for display program state information. In effect, this
828In effect, this makes Emacs into an IDE (interactive development 849makes Emacs into an IDE (interactive development environment). With
829environment). With it, you do not need to use textual GDB commands; 850it, you do not need to use textual GDB commands; you can control the
830you can control the debugging session with the mouse. For example, 851debugging session with the mouse. For example, you can click in the
831you can click in the fringe of a source buffer to set a breakpoint 852fringe of a source buffer to set a breakpoint there, or on a stack
832there, or on a stack frame in the stack buffer to select that frame. 853frame in the stack buffer to select that frame.
833 854
834 This mode requires telling GDB that its ``screen size'' is 855 This mode requires telling GDB that its ``screen size'' is
835unlimited, so it sets the height and width accordingly. For correct 856unlimited, so it sets the height and width accordingly. For correct
@@ -1382,25 +1403,23 @@ used; its default is @code{t}.
1382@node Lisp Interaction 1403@node Lisp Interaction
1383@section Lisp Interaction Buffers 1404@section Lisp Interaction Buffers
1384 1405
1385 The buffer @samp{*scratch*} which is selected when Emacs starts up is 1406 When Emacs starts up, it contains a buffer named @samp{*scratch*},
1386provided for evaluating Lisp expressions interactively inside Emacs. 1407which is provided for evaluating Lisp expressions interactively inside
1387 1408Emacs. Its major mode is Lisp Interaction mode.
1388 The simplest way to use the @samp{*scratch*} buffer is to insert Lisp
1389expressions and type @kbd{C-j} after each expression. This command
1390reads the Lisp expression before point, evaluates it, and inserts the
1391value in printed representation before point. The result is a complete
1392typescript of the expressions you have evaluated and their values.
1393 1409
1394 The @samp{*scratch*} buffer's major mode is Lisp Interaction mode, which 1410@findex eval-print-last-sexp
1395is the same as Emacs-Lisp mode except for the binding of @kbd{C-j}. 1411@kindex C-j @r{(Lisp Interaction mode)}
1412 The simplest way to use the @samp{*scratch*} buffer is to insert
1413Lisp expressions and type @kbd{C-j} (@code{eval-print-last-sexp})
1414after each expression. This command reads the Lisp expression before
1415point, evaluates it, and inserts the value in printed representation
1416before point. The result is a complete typescript of the expressions
1417you have evaluated and their values.
1396 1418
1397@findex lisp-interaction-mode 1419@findex lisp-interaction-mode
1398 The rationale for this feature is that Emacs must have a buffer when 1420 All other commands in Lisp Interaction mode are the same as in Emacs
1399it starts up, but that buffer is not useful for editing files since a 1421Lisp mode. You can enable Lisp Interaction mode by typing @kbd{M-x
1400new buffer is made for every file that you visit. The Lisp interpreter 1422lisp-interaction-mode}.
1401typescript is the most useful thing I can think of for the initial
1402buffer to do. Type @kbd{M-x lisp-interaction-mode} to put the current
1403buffer in Lisp Interaction mode.
1404 1423
1405@findex ielm 1424@findex ielm
1406 An alternative way of evaluating Emacs Lisp expressions interactively 1425 An alternative way of evaluating Emacs Lisp expressions interactively