aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard M. Stallman2003-05-28 11:42:49 +0000
committerRichard M. Stallman2003-05-28 11:42:49 +0000
commitf9ad161b282e67373227d6ed2d1604b6a18d2ec2 (patch)
treea5dff29bf302b22e456e5741d836d198c5e9ee27
parent45f266dcb548c1e57a3132347329f2b56cd17f43 (diff)
downloademacs-f9ad161b282e67373227d6ed2d1604b6a18d2ec2.tar.gz
emacs-f9ad161b282e67373227d6ed2d1604b6a18d2ec2.zip
(GDB Graphical Interface): New node (rewritten somewhat by RMS).
-rw-r--r--man/ChangeLog5
-rw-r--r--man/building.texi204
2 files changed, 209 insertions, 0 deletions
diff --git a/man/ChangeLog b/man/ChangeLog
index 1f52a603228..9170a4912e0 100644
--- a/man/ChangeLog
+++ b/man/ChangeLog
@@ -1,3 +1,8 @@
12003-05-28 Nick Roberts <nick@nick.uklinux.net>
2
3 * building.texi (GDB Graphical Interface): New node.
4 (Rewritten somewhat by RMS.)
5
12003-05-28 Kai Gro,A_(Bjohann <kai.grossjohann@gmx.net> 62003-05-28 Kai Gro,A_(Bjohann <kai.grossjohann@gmx.net>
2 7
3 * custom.texi (Init Rebinding): Xref Non-ASCII Rebinding, for 8 * custom.texi (Init Rebinding): Xref Non-ASCII Rebinding, for
diff --git a/man/building.texi b/man/building.texi
index 8169b64a1bf..e9dd079ccd9 100644
--- a/man/building.texi
+++ b/man/building.texi
@@ -288,6 +288,9 @@ for information on debugging Emacs Lisp programs.
288* Commands of GUD:: Key bindings for common commands. 288* Commands of GUD:: Key bindings for common commands.
289* GUD Customization:: Defining your own commands for GUD. 289* GUD Customization:: Defining your own commands for GUD.
290* GUD Tooltips:: Showing variable values by pointing with the mouse. 290* GUD Tooltips:: Showing variable values by pointing with the mouse.
291* GDB Graphical Interface:: An enhanced mode that uses GDB features to
292 implement a graphical debugging environment through
293 Emacs.
291@end menu 294@end menu
292 295
293@node Starting GUD 296@node Starting GUD
@@ -303,6 +306,10 @@ Run GDB as a subprocess of Emacs. This command creates a buffer
303for input and output to GDB, and switches to it. If a GDB buffer 306for input and output to GDB, and switches to it. If a GDB buffer
304already exists, it just switches to that buffer. 307already exists, it just switches to that buffer.
305 308
309@item M-x gdba @key{RET} @var{file} @key{RET}
310Run GDB as a subprocess of Emacs, providing a graphical interface
311to GDB features through Emacs. @xref{GDB Graphical Interface}.
312
306@item M-x dbx @key{RET} @var{file} @key{RET} 313@item M-x dbx @key{RET} @var{file} @key{RET}
307@findex dbx 314@findex dbx
308Similar, but run DBX instead of GDB. 315Similar, but run DBX instead of GDB.
@@ -478,6 +485,21 @@ equivalent to the @samp{down} command.
478 If you are using GDB, these additional key bindings are available: 485 If you are using GDB, these additional key bindings are available:
479 486
480@table @kbd 487@table @kbd
488@item C-c C-r
489@kindex C-c C-r @r{(GUD)}
490@itemx C-x C-a C-r
491@findex gud-run
492Start execution of the program (@code{gud-run}).
493
494@item C-c C-u
495@kindex C-c C-u @r{(GUD)}
496@itemx C-x C-a C-u
497@findex gud-until
498Continue execution to the current line. The program will run until
499it hits a breakpoint, terminates, gets a signal that the debugger is
500checking for, or reaches the line on which the cursor currently sits
501(@code{gud-until}).
502
481@item @key{TAB} 503@item @key{TAB}
482@kindex TAB @r{(GUD)} 504@kindex TAB @r{(GUD)}
483@findex gud-gdb-complete-command 505@findex gud-gdb-complete-command
@@ -587,6 +609,188 @@ variable values can be displayed in tooltips by pointing at them with
587the mouse in the GUD buffer or in source buffers with major modes in the 609the mouse in the GUD buffer or in source buffers with major modes in the
588customizable list @code{tooltip-gud-modes}. 610customizable list @code{tooltip-gud-modes}.
589 611
612@node GDB Graphical Interface
613@subsection GDB Graphical Interface
614
615@findex gdba
616The command @code{gdba} starts GDB using a graphical interface where
617you view and control the program's data using Emacs windows. You can
618still interact with GDB through the GUD buffer, but the point of this
619mode is that you can do it through menus and clicks, without needing
620to know GDB commands.
621
622@menu
623* Breakpoints Buffer:: A breakpoint control panel.
624* Stack Buffer:: Select a frame from the call stack.
625* Data Display:: Display and update expressions in their own buffer.
626* Display Buffer:: Control the displayed expressions.
627* Other Buffers:: Input/output, locals, registers and assembler buffers.
628* Layout:: Control the number of displayed buffers.
629@end menu
630
631@node Breakpoints Buffer
632@subsubsection Breakpoints Buffer
633
634The breakpoints buffer shows the existing breakpoints and watchpoints
635(@pxref{Breakpoints,,, gdb, The GNU debugger}). It has three special
636commands:
637
638@table @kbd
639@item @key{SPC}
640@kindex SPC @r{(GDB breakpoints buffer)}
641@findex gdb-toggle-breakpoint
642Enable/disable the breakpoint at the current line
643(@code{gdb-toggle-breakpoint}). On a graphical display, this changes
644the color of a bullet in the margin of the source buffer at the
645relevant line. This is red when the breakpoint is enabled and grey
646when it is disabled. Text-only terminals correspondingly display
647a @samp{B} or @samp{b}.
648
649@item @kbd{d}
650@kindex d @r{(GDB breakpoints buffer)}
651@findex gdb-delete-breakpoint
652Delete the breakpoint at the current line (@code{gdb-delete-breakpoint}).
653
654@item @key{RET}
655@kindex RET @r{(GDB breakpoints buffer)}
656@findex gdb-goto-breakpoint
657Display the file in the source buffer at the breakpoint specified at
658the current line (@code{gdb-goto-breakpoint}). Alternatively, click @kbd{Mouse-2} on the breakpoint that you wish to visit.
659@end table
660
661@node Stack Buffer
662@subsubsection Stack Buffer
663
664The stack buffer displays a @dfn{call stack}, with one line for each
665of the nested subroutine calls (@dfn{stack frames}) now active in the
666program. @xref{Backtrace,,info stack, gdb, The GNU debugger}.
667
668Move point to any frame in the stack and type @key{RET} to make it
669become the current frame (@code{gdb-frames-select}) and display the
670associated source in the source buffer. Alternatively, click
671@kbd{Mouse-2} to make the selected frame become the current one. If the
672locals buffer is displayed then its contents update to display the
673variables that are local to the new frame.
674
675@node Data Display
676@subsubsection Data Display
677@cindex displaying expressions in GDB
678
679If you want to see how a variable changes each time your program stops
680then place the cursor over the variable name and click on the display
681icon in the toolbar (@code{gud-display}).
682
683Each displayed expression has its own frame on a graphical display and
684its own buffer on a text-only terminal. Arrays and structures have
685their own display formats. To display an array as a slice, at the top
686of the display window, click @kbd{Mouse-2} on the array index that you
687want to restrict and you will be prompted in the mini-buffer for a
688start and a stop value. Click @kbd{Mouse-2} on a pointer to
689dereference it in the same frame/buffer. Click @kbd{S-Mouse-2} there
690to do the same thing but in a new frame/buffer. There are two special
691commands for these buffers:
692
693@table @kbd
694@item @kbd{v}
695@kindex v @r{(GDB data buffer)}
696@findex gdb-array-visualise
697Visualise an array using the graph program from plotutils if this is
698installed. This only works for one dimensional arrays
699(@code{gdb-array-visualise}).
700
701@item @kbd{q}
702@kindex q @r{(GDB data buffer)}
703@findex gdb-delete-expression
704Delete the displayed expression and the associated frame
705(@code{gdb-delete-expression}).
706@end table
707
708@node Display Buffer
709@subsubsection Display Buffer
710
711The display buffer shows the list of displayed expressions
712(@pxref{Auto Display,,, gdb, The GNU debugger}). As with the
713breakpoints, you can enable/disable or delete the displayed
714expressions:
715
716@table @kbd
717@item @key{SPC}
718@kindex SPC @r{(GDB display buffer)}
719@findex gdb-toggle-display
720Enable/disable the display at the current line
721(@code{gdb-toggle-display}).
722
723@item @kbd{d}
724@kindex d @r{(GDB display buffer)}
725@findex gdb-delete-display
726Delete the display at the current line (@code{gdb-delete-display}).
727@end table
728
729@node Other Buffers
730@subsubsection Other Buffers
731
732@table @asis
733@item Input/Output Buffer
734The executable program that is being debugged takes its input and
735displays its output here. Some of the commands from shell mode are
736available here. @xref{Shell Mode}.
737
738@item Locals Buffer
739The locals buffer displays the values of local variables of the
740current frame for simple data types (@pxref{Frame Info,,, gdb, The GNU
741debugger}).
742
743Arrays and structures display their type only. You must display them
744separately to examine their values. @ref{Data Display}.
745
746@item Registers Buffer
747The registers buffer displays the values held by the registers
748(@pxref{Registers,,, gdb, The GNU debugger}).
749
750@item Assembler Buffer
751The assembler buffer displays the current frame as machine code. An
752overlay arrow points to the current instruction and you can set and
753remove breakpoints as with the source buffer. Breakpoints also
754appear in the margin.
755@end table
756
757@node Layout
758@subsubsection Layout
759@cindex GDB User Interface layout
760You may choose to display the additional buffers described previously
761either in the same frame or a different one. Select GDB-windows or
762GDB-Frames from the menu-bar under the heading GUD. If the menu-bar
763is unavailable, type @code{M-x
764gdb-display-@var{buffertype}-buffer} or @code{M-x
765gdb-frame-@var{buffertype}-buffer} respectively, where @var{buffertype}
766is the relevant buffer type e.g breakpoints.
767
768@findex gdb-many-windows
769@vindex gdb-many-windows
770If @code{gdb-many-windows} is @code{nil} (the default value), then GDB starts
771with just two windows: the GUD and the source buffer. If it is @code{t}, then
772six windows with the following layout will appear:
773
774@multitable @columnfractions .5 .5
775@item GUD buffer (I/O of GDB)
776@tab Locals buffer
777@item
778@tab
779@item Source buffer
780@tab Input/Output (of debuggee) buffer
781@item
782@tab
783@item Stack buffer
784@tab Breakpoints buffer
785@end multitable
786
787To toggle this layout, do @kbd{M-x gdb-many-windows}.
788
789@findex gdb-restore-windows
790If you change the window layout, for example, while editing and
791re-compiling your program, then you can restore it with
792@code{gdb-restore-windows}.
793
590@node Executing Lisp 794@node Executing Lisp
591@section Executing Lisp Expressions 795@section Executing Lisp Expressions
592 796