diff options
| author | Chong Yidong | 2008-10-31 06:16:20 +0000 |
|---|---|---|
| committer | Chong Yidong | 2008-10-31 06:16:20 +0000 |
| commit | a03334cadfd29655477a020fcc1a94d23d13c80a (patch) | |
| tree | 564f89b468407384c9f80ad5392e2374e9db3a39 | |
| parent | d52582c3625bb7ccb288478739273ce3287048f0 (diff) | |
| download | emacs-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.texi | 139 |
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}, |
| 67 | which is correct most of the time for nontrivial programs. | 67 | which 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 |
| 69 | compile} before, the default each time is the command you used the | 69 | compile} before, the default each time is the command you used the |
| 70 | previous time. @code{compile} stores this command in the variable | 70 | previous 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 |
| 198 | point in the @samp{*compilation*} buffer to that error message and | 199 | point in the @samp{*compilation*} buffer to that error message and |
| 199 | typing @key{RET} (@code{compile-goto-error}). Alternatively, you can | 200 | typing @key{RET} (@code{compile-goto-error}). Alternatively, you can |
| 200 | click @kbd{Mouse-2} on the error message; you need not switch to the | 201 | click @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, | ||
| 204 | Emacs automatically jumps to the first error (if any exists) once | ||
| 205 | compilation 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 | |||
| 450 | Emacs provides two separate facilities for using external symbolic | ||
| 451 | debuggers, which are programs for testing and debugging other | ||
| 452 | programs: | ||
| 453 | @itemize @bullet | ||
| 454 | @item | ||
| 455 | The Grand Unified Debugger (GUD) provides a simple, text-based | ||
| 456 | interface for a wide variety of symbolic debuggers, including the GNU | ||
| 457 | Debugger (GDB), the Perl debugger, the Python debugger, and the Java | ||
| 458 | Debugger. | ||
| 459 | |||
| 460 | @item | ||
| 461 | The GDB Graphical Interface is an Emacs package that interacts with | ||
| 462 | GDB to turn Emacs into a graphical ``integrated development | ||
| 463 | environment'', or IDE. | ||
| 464 | @end itemize | ||
| 465 | |||
| 466 | In addition, Emacs contains a built-in system for debugging Emacs | ||
| 467 | Lisp programs. @xref{Debugging,, The Lisp Debugger, elisp, the Emacs | ||
| 468 | Lisp 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? |
| 453 | The GUD (Grand Unified Debugger) library provides an interface to | 487 | The GUD (Grand Unified Debugger) library provides an Emacs interface |
| 454 | various symbolic debuggers from within Emacs. We recommend the | 488 | to a wide variety of symbolic debuggers. Unlike the GDB graphical |
| 455 | debugger GDB, which is free software, but GUD can also run DBX, SDB or | 489 | interface, which only runs GDB (@pxref{GDB Graphical Interface}), GUD |
| 456 | XDB. GUD can also serve as an interface to Perl's debugging mode, the | 490 | can also run DBX, SDB, XDB, Perl's debugging mode, the Python debugger |
| 457 | Python debugger PDB, and to JDB, the Java Debugger. | 491 | PDB, or the Java Debugger JDB. |
| 458 | @xref{Debugging,, The Lisp Debugger, elisp, the Emacs Lisp Reference | ||
| 459 | Manual}, 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 |
| 475 | to a particular debugger program. | 504 | corresponding 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 | ||
| 480 | Run GDB as a subprocess of Emacs. This uses an IDE-like graphical | ||
| 481 | interface; see @ref{GDB Graphical Interface}. Only GDB works with the | ||
| 482 | graphical 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 |
| 486 | Run GDB as a subprocess of Emacs. This command creates a buffer for | 509 | Run GDB as a subprocess of Emacs. This command creates a buffer for |
| 487 | input and output to GDB, and switches to it. If a GDB buffer already | 510 | input and output to GDB, and switches to it. If a GDB buffer already |
| 488 | exists, it just switches to that buffer. | 511 | exists, it just switches to that buffer. (To run GDB in an IDE-like |
| 512 | graphical 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 |
| 492 | Run DBX as a subprocess of Emacs. Since Emacs does not implement a | 516 | Run DBX as a subprocess of Emacs. |
| 493 | graphical interface for DBX, communication with DBX works by typing | ||
| 494 | commands in the GUD interaction buffer. The same is true for all | ||
| 495 | the 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 |
| 500 | Similar, but run XDB. Use the variable | 521 | Run 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 |
| 502 | files. | 523 | files. |
| 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 |
| 506 | Similar, but run SDB. | 527 | Run SDB as a subprocess of Emacs. |
| 507 | 528 | ||
| 508 | Some versions of SDB do not mention source file names in their | 529 | Some versions of SDB do not mention source file names in their |
| 509 | messages. When you use them, you need to have a valid tags table | 530 | messages. 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. |
| 511 | If you have not visited a tags table or the tags table doesn't list one | 532 | If you have not visited a tags table or the tags table doesn't list |
| 512 | of the functions, you get a message saying @samp{The sdb support | 533 | one of the functions, you get a message saying @samp{The sdb support |
| 513 | requires a valid tags table to work}. If this happens, generate a valid | 534 | requires a valid tags table to work}. If this happens, generate a |
| 514 | tags table in the working directory and try again. | 535 | valid 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 | |||
| 533 | allowed. GUD assumes that the first argument not starting with a | 554 | allowed. 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 |
| 537 | Tramp provides a facility to debug programs on remote hosts | 558 | Tramp 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 |
| 539 | remote host,, tramp, The Tramp Manual}), whereby both the debugger and | 560 | remote host,, tramp, The Tramp Manual}), whereby both the debugger and |
| @@ -544,7 +565,7 @@ GDB remote debugging feature, for example (@pxref{Remote Debugging,, | |||
| 544 | Debugging Remote Programs, gdb, The GNU debugger}). | 565 | Debugging 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 | |||
| 591 | effects. | 612 | effects. |
| 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 |
| 597 | Emacs commands of Shell mode are available (@pxref{Shell Mode}). All | 618 | Emacs 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. | |||
| 748 | Instead, type @kbd{C-q @key{TAB}} to enter a tab. | 769 | Instead, 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 |
| 827 | interface, using Emacs windows for display program state information. | 848 | Emacs windows for display program state information. In effect, this |
| 828 | In effect, this makes Emacs into an IDE (interactive development | 849 | makes Emacs into an IDE (interactive development environment). With |
| 829 | environment). With it, you do not need to use textual GDB commands; | 850 | it, you do not need to use textual GDB commands; you can control the |
| 830 | you can control the debugging session with the mouse. For example, | 851 | debugging session with the mouse. For example, you can click in the |
| 831 | you can click in the fringe of a source buffer to set a breakpoint | 852 | fringe of a source buffer to set a breakpoint there, or on a stack |
| 832 | there, or on a stack frame in the stack buffer to select that frame. | 853 | frame 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 |
| 835 | unlimited, so it sets the height and width accordingly. For correct | 856 | unlimited, 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*}, |
| 1386 | provided for evaluating Lisp expressions interactively inside Emacs. | 1407 | which is provided for evaluating Lisp expressions interactively inside |
| 1387 | 1408 | Emacs. Its major mode is Lisp Interaction mode. | |
| 1388 | The simplest way to use the @samp{*scratch*} buffer is to insert Lisp | ||
| 1389 | expressions and type @kbd{C-j} after each expression. This command | ||
| 1390 | reads the Lisp expression before point, evaluates it, and inserts the | ||
| 1391 | value in printed representation before point. The result is a complete | ||
| 1392 | typescript 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 |
| 1395 | is 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 | ||
| 1413 | Lisp expressions and type @kbd{C-j} (@code{eval-print-last-sexp}) | ||
| 1414 | after each expression. This command reads the Lisp expression before | ||
| 1415 | point, evaluates it, and inserts the value in printed representation | ||
| 1416 | before point. The result is a complete typescript of the expressions | ||
| 1417 | you 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 |
| 1399 | it starts up, but that buffer is not useful for editing files since a | 1421 | Lisp mode. You can enable Lisp Interaction mode by typing @kbd{M-x |
| 1400 | new buffer is made for every file that you visit. The Lisp interpreter | 1422 | lisp-interaction-mode}. |
| 1401 | typescript is the most useful thing I can think of for the initial | ||
| 1402 | buffer to do. Type @kbd{M-x lisp-interaction-mode} to put the current | ||
| 1403 | buffer 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 |