aboutsummaryrefslogtreecommitdiffstats
path: root/man/building.texi
diff options
context:
space:
mode:
Diffstat (limited to 'man/building.texi')
-rw-r--r--man/building.texi155
1 files changed, 84 insertions, 71 deletions
diff --git a/man/building.texi b/man/building.texi
index 549c69da544..01cdf88fe39 100644
--- a/man/building.texi
+++ b/man/building.texi
@@ -833,17 +833,17 @@ Emacs session. If you have customized @code{gud-gdb-command-name} in
833that way, you can use @kbd{M-x gdba} to invoke GDB in graphical mode. 833that way, you can use @kbd{M-x gdba} to invoke GDB in graphical mode.
834 834
835@menu 835@menu
836* GDB User Interface Layout:: Control the number of displayed buffers. 836* GDB-UI Layout:: Control the number of displayed buffers.
837* Source Buffers:: Use the mouse in the fringe/margin to
838 control your program.
837* Breakpoints Buffer:: A breakpoint control panel. 839* Breakpoints Buffer:: A breakpoint control panel.
838* Stack Buffer:: Select a frame from the call stack. 840* Stack Buffer:: Select a frame from the call stack.
839* Other GDB User Interface Buffers:: Input/output, locals, registers, 841* Other GDB-UI Buffers:: Input/output, locals, registers,
840 assembler, threads and memory buffers. 842 assembler, threads and memory buffers.
841* GDB commands in the Fringe:: Use the mouse in the fringe/margin to
842 control your program.
843* Watch Expressions:: Monitor variable values in the speedbar. 843* Watch Expressions:: Monitor variable values in the speedbar.
844@end menu 844@end menu
845 845
846@node GDB User Interface Layout 846@node GDB-UI Layout
847@subsubsection GDB User Interface Layout 847@subsubsection GDB User Interface Layout
848@cindex GDB User Interface layout 848@cindex GDB User Interface layout
849 849
@@ -863,7 +863,7 @@ displays the following frame layout:
863+--------------------------------+--------------------------------+ 863+--------------------------------+--------------------------------+
864| GUD buffer (I/O of GDB) | Locals buffer | 864| GUD buffer (I/O of GDB) | Locals buffer |
865|--------------------------------+--------------------------------+ 865|--------------------------------+--------------------------------+
866| Source buffer | I/O buffer for debugged pgm | 866| Primary Source buffer | I/O buffer for debugged pgm |
867|--------------------------------+--------------------------------+ 867|--------------------------------+--------------------------------+
868| Stack buffer | Breakpoints buffer | 868| Stack buffer | Breakpoints buffer |
869+--------------------------------+--------------------------------+ 869+--------------------------------+--------------------------------+
@@ -871,8 +871,8 @@ displays the following frame layout:
871@end smallexample 871@end smallexample
872 872
873 However, if @code{gdb-use-separate-io-buffer} is @code{nil}, the I/O 873 However, if @code{gdb-use-separate-io-buffer} is @code{nil}, the I/O
874buffer does not appear and the source buffer occupies the full width 874buffer does not appear and the primary source buffer occupies the full
875of the frame. 875width of the frame.
876 876
877@findex gdb-restore-windows 877@findex gdb-restore-windows
878 If you change the window layout, for example, while editing and 878 If you change the window layout, for example, while editing and
@@ -884,7 +884,7 @@ layout with the command @code{gdb-restore-windows}.
884containing just the GUD buffer and a source file, type @kbd{M-x 884containing just the GUD buffer and a source file, type @kbd{M-x
885gdb-many-windows}. 885gdb-many-windows}.
886 886
887 You may also specify additional GUD-related buffers to display, 887 You may also specify additional GDB-related buffers to display,
888either in the same frame or a different one. Select the buffers you 888either in the same frame or a different one. Select the buffers you
889want with the @samp{GUD->GDB-windows} and @samp{GUD->GDB-Frames} 889want with the @samp{GUD->GDB-windows} and @samp{GUD->GDB-Frames}
890sub-menus. If the menu-bar is unavailable, type @code{M-x 890sub-menus. If the menu-bar is unavailable, type @code{M-x
@@ -904,6 +904,61 @@ as well as GDB's breakpoints. You do need to check that the
904breakpoints in recently edited source files are still in the right 904breakpoints in recently edited source files are still in the right
905places. 905places.
906 906
907@node Source Buffers
908@subsubsection Source Buffers
909@cindex GDB commands in Fringe
910
911@c @findex gdb-mouse-set-clear-breakpoint
912@c @findex gdb-mouse-toggle-breakpoint
913Many GDB commands can be entered using keybindings or the tool bar but
914sometimes it is quicker to use the fringe. These commands either
915manipulate breakpoints or control program execution. When there is no
916fringe, you can use the margin but this is only present when the
917source file already has a breakpoint.
918
919You can click @kbd{Mouse-1} in the fringe or display margin of a
920source buffer to set a breakpoint there and, on a graphical display, a
921red bullet will appear on that line. If a breakpoint already exists
922on that line, the same click will remove it. You can also enable or
923disable a breakpoint by clicking @kbd{C-Mouse-1} on the bullet.
924
925A solid arrow in the left fringe of a source buffer indicates the line
926of the innermost frame where the debugged program has stopped. A
927hollow arrow indicates the current execution line of higher level
928frames.
929
930If you drag the arrow in the fringe with @kbd{Mouse-1}
931(@code{gdb-mouse-until}), execution will continue to the line where
932you release the button, provided it is still in the same frame.
933Alternatively, you can click @kbd{Mouse-3} at some point in the fringe
934of this buffer and execution will advance to there. A similar command
935(@code{gdb-mouse-jump}) allows you to jump to a source line without
936executing the intermediate lines by clicking @kbd{C-Mouse-3}. This
937command allows you to go backwards which can be useful for running
938through code that has already executed, in order to examine its
939execution in more detail.
940
941@table @kbd
942@item Mouse-1
943Set or clear a breakpoint.
944
945@item C-Mouse-1
946Enable or disable a breakpoint.
947
948@item Mouse-3
949Continue execution to here.
950
951@item C-Mouse-3
952Jump to here.
953@end table
954
955If the variable @code{gdb-find-source-frame} is non-@code{nil} and
956execution stops in a frame for which there is no source code e.g after
957an interrupt, then Emacs finds and displays the first frame further up
958stack for which there is source. If it is @code{nil} then the source
959buffer continues to display the last frame which maybe more useful,
960for example, when re-setting a breakpoint.
961
907@node Breakpoints Buffer 962@node Breakpoints Buffer
908@subsubsection Breakpoints Buffer 963@subsubsection Breakpoints Buffer
909 964
@@ -918,7 +973,7 @@ breakpoint}, the breakpoint which point is on.
918@findex gdb-toggle-breakpoint 973@findex gdb-toggle-breakpoint
919Enable/disable the current breakpoint (@code{gdb-toggle-breakpoint}). 974Enable/disable the current breakpoint (@code{gdb-toggle-breakpoint}).
920On a graphical display, this changes the color of a bullet in the 975On a graphical display, this changes the color of a bullet in the
921margin of the source buffer at the relevant line. This is red when 976margin of a source buffer at the relevant line. This is red when
922the breakpoint is enabled and grey when it is disabled. Text-only 977the breakpoint is enabled and grey when it is disabled. Text-only
923terminals correspondingly display a @samp{B} or @samp{b}. 978terminals correspondingly display a @samp{B} or @samp{b}.
924 979
@@ -946,34 +1001,35 @@ of the nested subroutine calls (@dfn{stack frames}) now active in the
946program. @xref{Backtrace,, Backtraces, gdb, The GNU debugger}. 1001program. @xref{Backtrace,, Backtraces, gdb, The GNU debugger}.
947 1002
948@findex gdb-frames-select 1003@findex gdb-frames-select
949 The selected frame number is displayed in reverse contrast. To 1004An arrow in the fringe points to the selected frame or, if the fringe is
950select a frame in GDB, move point in the stack buffer to that stack 1005not present, the number of the selected frame is displayed in reverse
951frame and type @key{RET} (@code{gdb-frames-select}), or click 1006contrast. To select a frame in GDB, move point in the stack buffer to
1007that stack frame and type @key{RET} (@code{gdb-frames-select}), or click
952@kbd{Mouse-2} on a stack frame. If the locals buffer is visible, 1008@kbd{Mouse-2} on a stack frame. If the locals buffer is visible,
953selecting a stack frame updates it to display the local variables of 1009selecting a stack frame updates it to display the local variables of the
954the new frame. 1010new frame.
955 1011
956@node Other GDB User Interface Buffers 1012@node Other GDB-UI Buffers
957@subsubsection Other Buffers 1013@subsubsection Other Buffers
958 1014
959@table @asis 1015@table @asis
960@item Input/Output Buffer 1016@item Input/Output Buffer
961@vindex gdb-use-separate-io-buffer 1017@vindex gdb-use-separate-io-buffer
962If the variable @code{gdb-use-separate-io-buffer} is non-@code{nil}, 1018If the variable @code{gdb-use-separate-io-buffer} is non-@code{nil},
963the executable program that is being debugged takes its input and 1019the program being debugged takes its input and displays its output
964displays its output here. Otherwise it uses the GUD buffer for that. 1020here. Otherwise it uses the GUD buffer for that. To toggle whether
965To toggle whether GUD mode uses this buffer, do @kbd{M-x 1021GUD mode uses this buffer, do @kbd{M-x gdb-use-separate-io-buffer}.
966gdb-use-separate-io-buffer}. That takes effect when you next 1022This takes effect when you next restart the program you are debugging.
967restart the program you are debugging.
968 1023
969The history and replay commands from Shell mode are available here, 1024The history and replay commands from Shell mode are available here,
970as are the commands to send signals to the program you are debugging. 1025as are the commands to send signals to the debugged program.
971@xref{Shell Mode}. 1026@xref{Shell Mode}.
972 1027
973@item Locals Buffer 1028@item Locals Buffer
974The locals buffer displays the values of local variables of the 1029The locals buffer displays the values of local variables of the
975current frame for simple data types (@pxref{Frame Info, Frame Info, 1030current frame for simple data types (@pxref{Frame Info, Frame Info,
976Information on a frame, gdb, The GNU debugger}). 1031Information on a frame, gdb, The GNU debugger}). Press @key{RET} or
1032click @kbd{Mouse-2} on the value if you want to edit it.
977 1033
978Arrays and structures display their type only. With GDB 6.4 or later, 1034Arrays and structures display their type only. With GDB 6.4 or later,
979move point to their name and press @key{RET}, or alternatively click 1035move point to their name and press @key{RET}, or alternatively click
@@ -985,7 +1041,7 @@ of GDB, use @kbd{Mouse-2} or @key{RET} on the type description
985@findex toggle-gdb-all-registers 1041@findex toggle-gdb-all-registers
986The registers buffer displays the values held by the registers 1042The registers buffer displays the values held by the registers
987(@pxref{Registers,,, gdb, The GNU debugger}). Press @key{RET} or 1043(@pxref{Registers,,, gdb, The GNU debugger}). Press @key{RET} or
988click @kbd{Mouse-2} on a register if you want to change its value. 1044click @kbd{Mouse-2} on a register if you want to edit its value.
989With GDB 6.4 or later, recently changed register values display with 1045With GDB 6.4 or later, recently changed register values display with
990@code{font-lock-warning-face}. With earlier versions of GDB, you can 1046@code{font-lock-warning-face}. With earlier versions of GDB, you can
991press @key{SPC} to toggle the display of floating point registers 1047press @key{SPC} to toggle the display of floating point registers
@@ -1003,10 +1059,10 @@ The threads buffer displays a summary of all threads currently in your
1003program (@pxref{Threads, Threads, Debugging programs with multiple 1059program (@pxref{Threads, Threads, Debugging programs with multiple
1004threads, gdb, The GNU debugger}). Move point to any thread in the 1060threads, gdb, The GNU debugger}). Move point to any thread in the
1005list and press @key{RET} to select it (@code{gdb-threads-select}) and 1061list and press @key{RET} to select it (@code{gdb-threads-select}) and
1006display the associated source in the source buffer. Alternatively, 1062display the associated source in the primary source buffer.
1007click @kbd{Mouse-2} on a thread to select it. If the locals buffer is 1063Alternatively, click @kbd{Mouse-2} on a thread to select it. If the
1008visible, its contents update to display the variables that are local 1064locals buffer is visible, its contents update to display the variables
1009in the new thread. 1065that are local in the new thread.
1010 1066
1011@item Memory Buffer 1067@item Memory Buffer
1012The memory buffer lets you examine sections of program memory 1068The memory buffer lets you examine sections of program memory
@@ -1017,49 +1073,6 @@ displays. Click @kbd{Mouse-3} on the header line to select the
1017display format or unit size for these data items. 1073display format or unit size for these data items.
1018@end table 1074@end table
1019 1075
1020@node GDB commands in the Fringe
1021@subsubsection GDB commands in the Fringe
1022@cindex GDB commands in the Fringe
1023
1024@c @findex gdb-mouse-set-clear-breakpoint
1025@c @findex gdb-mouse-toggle-breakpoint
1026Many GDB commands can be entered using keybindings or the tool bar but
1027sometimes it is quicker to use the fringe. These commands either
1028manipulate breakpoints or control program execution. When there is no
1029fringe, you can use the margin but this is only present when the
1030source file already has a breakpoint.
1031
1032You can click @kbd{Mouse-1} in the fringe or display margin of a
1033source buffer to set a breakpoint there and, on a graphical display, a
1034red bullet will appear on that line. If a breakpoint already exists
1035on that line, the same click will remove it. You can also enable or
1036disable a breakpoint by clicking @kbd{C-Mouse-1} on the bullet.
1037
1038If you drag the debugger arrow in the fringe with @kbd{Mouse-1}
1039(@code{gdb-mouse-until}), execution will continue to the line where
1040you release the button, provided it is still in the same frame.
1041Alternatively, you can click @kbd{Mouse-3} at some point in the fringe
1042of this buffer and execution will advance to there. A similar command
1043(@code{gdb-mouse-jump}) allows you to jump to a source line without
1044executing the intermediate lines by clicking @kbd{C-Mouse-3}. This
1045command allows you to go backwards which can be useful for running
1046through code that has already executed, in order to examine its
1047execution in more detail.
1048
1049@table @kbd
1050@item Mouse-1
1051Set or clear a breakpoint.
1052
1053@item C-Mouse-1
1054Enable or disable a breakpoint.
1055
1056@item Mouse-3
1057Continue execution to here.
1058
1059@item C-Mouse-3
1060Jump to here.
1061@end table
1062
1063@node Watch Expressions 1076@node Watch Expressions
1064@subsubsection Watch Expressions 1077@subsubsection Watch Expressions
1065@cindex Watching expressions in GDB 1078@cindex Watching expressions in GDB