diff options
Diffstat (limited to 'man/building.texi')
| -rw-r--r-- | man/building.texi | 155 |
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 | |||
| 833 | that way, you can use @kbd{M-x gdba} to invoke GDB in graphical mode. | 833 | that 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 |
| 874 | buffer does not appear and the source buffer occupies the full width | 874 | buffer does not appear and the primary source buffer occupies the full |
| 875 | of the frame. | 875 | width 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}. | |||
| 884 | containing just the GUD buffer and a source file, type @kbd{M-x | 884 | containing just the GUD buffer and a source file, type @kbd{M-x |
| 885 | gdb-many-windows}. | 885 | gdb-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, |
| 888 | either in the same frame or a different one. Select the buffers you | 888 | either in the same frame or a different one. Select the buffers you |
| 889 | want with the @samp{GUD->GDB-windows} and @samp{GUD->GDB-Frames} | 889 | want with the @samp{GUD->GDB-windows} and @samp{GUD->GDB-Frames} |
| 890 | sub-menus. If the menu-bar is unavailable, type @code{M-x | 890 | sub-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 | |||
| 904 | breakpoints in recently edited source files are still in the right | 904 | breakpoints in recently edited source files are still in the right |
| 905 | places. | 905 | places. |
| 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 | ||
| 913 | Many GDB commands can be entered using keybindings or the tool bar but | ||
| 914 | sometimes it is quicker to use the fringe. These commands either | ||
| 915 | manipulate breakpoints or control program execution. When there is no | ||
| 916 | fringe, you can use the margin but this is only present when the | ||
| 917 | source file already has a breakpoint. | ||
| 918 | |||
| 919 | You can click @kbd{Mouse-1} in the fringe or display margin of a | ||
| 920 | source buffer to set a breakpoint there and, on a graphical display, a | ||
| 921 | red bullet will appear on that line. If a breakpoint already exists | ||
| 922 | on that line, the same click will remove it. You can also enable or | ||
| 923 | disable a breakpoint by clicking @kbd{C-Mouse-1} on the bullet. | ||
| 924 | |||
| 925 | A solid arrow in the left fringe of a source buffer indicates the line | ||
| 926 | of the innermost frame where the debugged program has stopped. A | ||
| 927 | hollow arrow indicates the current execution line of higher level | ||
| 928 | frames. | ||
| 929 | |||
| 930 | If you drag the arrow in the fringe with @kbd{Mouse-1} | ||
| 931 | (@code{gdb-mouse-until}), execution will continue to the line where | ||
| 932 | you release the button, provided it is still in the same frame. | ||
| 933 | Alternatively, you can click @kbd{Mouse-3} at some point in the fringe | ||
| 934 | of 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 | ||
| 936 | executing the intermediate lines by clicking @kbd{C-Mouse-3}. This | ||
| 937 | command allows you to go backwards which can be useful for running | ||
| 938 | through code that has already executed, in order to examine its | ||
| 939 | execution in more detail. | ||
| 940 | |||
| 941 | @table @kbd | ||
| 942 | @item Mouse-1 | ||
| 943 | Set or clear a breakpoint. | ||
| 944 | |||
| 945 | @item C-Mouse-1 | ||
| 946 | Enable or disable a breakpoint. | ||
| 947 | |||
| 948 | @item Mouse-3 | ||
| 949 | Continue execution to here. | ||
| 950 | |||
| 951 | @item C-Mouse-3 | ||
| 952 | Jump to here. | ||
| 953 | @end table | ||
| 954 | |||
| 955 | If the variable @code{gdb-find-source-frame} is non-@code{nil} and | ||
| 956 | execution stops in a frame for which there is no source code e.g after | ||
| 957 | an interrupt, then Emacs finds and displays the first frame further up | ||
| 958 | stack for which there is source. If it is @code{nil} then the source | ||
| 959 | buffer continues to display the last frame which maybe more useful, | ||
| 960 | for 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 |
| 919 | Enable/disable the current breakpoint (@code{gdb-toggle-breakpoint}). | 974 | Enable/disable the current breakpoint (@code{gdb-toggle-breakpoint}). |
| 920 | On a graphical display, this changes the color of a bullet in the | 975 | On a graphical display, this changes the color of a bullet in the |
| 921 | margin of the source buffer at the relevant line. This is red when | 976 | margin of a source buffer at the relevant line. This is red when |
| 922 | the breakpoint is enabled and grey when it is disabled. Text-only | 977 | the breakpoint is enabled and grey when it is disabled. Text-only |
| 923 | terminals correspondingly display a @samp{B} or @samp{b}. | 978 | terminals 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 | |||
| 946 | program. @xref{Backtrace,, Backtraces, gdb, The GNU debugger}. | 1001 | program. @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 | 1004 | An arrow in the fringe points to the selected frame or, if the fringe is |
| 950 | select a frame in GDB, move point in the stack buffer to that stack | 1005 | not present, the number of the selected frame is displayed in reverse |
| 951 | frame and type @key{RET} (@code{gdb-frames-select}), or click | 1006 | contrast. To select a frame in GDB, move point in the stack buffer to |
| 1007 | that 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, |
| 953 | selecting a stack frame updates it to display the local variables of | 1009 | selecting a stack frame updates it to display the local variables of the |
| 954 | the new frame. | 1010 | new 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 |
| 962 | If the variable @code{gdb-use-separate-io-buffer} is non-@code{nil}, | 1018 | If the variable @code{gdb-use-separate-io-buffer} is non-@code{nil}, |
| 963 | the executable program that is being debugged takes its input and | 1019 | the program being debugged takes its input and displays its output |
| 964 | displays its output here. Otherwise it uses the GUD buffer for that. | 1020 | here. Otherwise it uses the GUD buffer for that. To toggle whether |
| 965 | To toggle whether GUD mode uses this buffer, do @kbd{M-x | 1021 | GUD mode uses this buffer, do @kbd{M-x gdb-use-separate-io-buffer}. |
| 966 | gdb-use-separate-io-buffer}. That takes effect when you next | 1022 | This takes effect when you next restart the program you are debugging. |
| 967 | restart the program you are debugging. | ||
| 968 | 1023 | ||
| 969 | The history and replay commands from Shell mode are available here, | 1024 | The history and replay commands from Shell mode are available here, |
| 970 | as are the commands to send signals to the program you are debugging. | 1025 | as 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 |
| 974 | The locals buffer displays the values of local variables of the | 1029 | The locals buffer displays the values of local variables of the |
| 975 | current frame for simple data types (@pxref{Frame Info, Frame Info, | 1030 | current frame for simple data types (@pxref{Frame Info, Frame Info, |
| 976 | Information on a frame, gdb, The GNU debugger}). | 1031 | Information on a frame, gdb, The GNU debugger}). Press @key{RET} or |
| 1032 | click @kbd{Mouse-2} on the value if you want to edit it. | ||
| 977 | 1033 | ||
| 978 | Arrays and structures display their type only. With GDB 6.4 or later, | 1034 | Arrays and structures display their type only. With GDB 6.4 or later, |
| 979 | move point to their name and press @key{RET}, or alternatively click | 1035 | move 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 |
| 986 | The registers buffer displays the values held by the registers | 1042 | The 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 |
| 988 | click @kbd{Mouse-2} on a register if you want to change its value. | 1044 | click @kbd{Mouse-2} on a register if you want to edit its value. |
| 989 | With GDB 6.4 or later, recently changed register values display with | 1045 | With 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 |
| 991 | press @key{SPC} to toggle the display of floating point registers | 1047 | press @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 | |||
| 1003 | program (@pxref{Threads, Threads, Debugging programs with multiple | 1059 | program (@pxref{Threads, Threads, Debugging programs with multiple |
| 1004 | threads, gdb, The GNU debugger}). Move point to any thread in the | 1060 | threads, gdb, The GNU debugger}). Move point to any thread in the |
| 1005 | list and press @key{RET} to select it (@code{gdb-threads-select}) and | 1061 | list and press @key{RET} to select it (@code{gdb-threads-select}) and |
| 1006 | display the associated source in the source buffer. Alternatively, | 1062 | display the associated source in the primary source buffer. |
| 1007 | click @kbd{Mouse-2} on a thread to select it. If the locals buffer is | 1063 | Alternatively, click @kbd{Mouse-2} on a thread to select it. If the |
| 1008 | visible, its contents update to display the variables that are local | 1064 | locals buffer is visible, its contents update to display the variables |
| 1009 | in the new thread. | 1065 | that are local in the new thread. |
| 1010 | 1066 | ||
| 1011 | @item Memory Buffer | 1067 | @item Memory Buffer |
| 1012 | The memory buffer lets you examine sections of program memory | 1068 | The 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 | |||
| 1017 | display format or unit size for these data items. | 1073 | display 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 | ||
| 1026 | Many GDB commands can be entered using keybindings or the tool bar but | ||
| 1027 | sometimes it is quicker to use the fringe. These commands either | ||
| 1028 | manipulate breakpoints or control program execution. When there is no | ||
| 1029 | fringe, you can use the margin but this is only present when the | ||
| 1030 | source file already has a breakpoint. | ||
| 1031 | |||
| 1032 | You can click @kbd{Mouse-1} in the fringe or display margin of a | ||
| 1033 | source buffer to set a breakpoint there and, on a graphical display, a | ||
| 1034 | red bullet will appear on that line. If a breakpoint already exists | ||
| 1035 | on that line, the same click will remove it. You can also enable or | ||
| 1036 | disable a breakpoint by clicking @kbd{C-Mouse-1} on the bullet. | ||
| 1037 | |||
| 1038 | If you drag the debugger arrow in the fringe with @kbd{Mouse-1} | ||
| 1039 | (@code{gdb-mouse-until}), execution will continue to the line where | ||
| 1040 | you release the button, provided it is still in the same frame. | ||
| 1041 | Alternatively, you can click @kbd{Mouse-3} at some point in the fringe | ||
| 1042 | of 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 | ||
| 1044 | executing the intermediate lines by clicking @kbd{C-Mouse-3}. This | ||
| 1045 | command allows you to go backwards which can be useful for running | ||
| 1046 | through code that has already executed, in order to examine its | ||
| 1047 | execution in more detail. | ||
| 1048 | |||
| 1049 | @table @kbd | ||
| 1050 | @item Mouse-1 | ||
| 1051 | Set or clear a breakpoint. | ||
| 1052 | |||
| 1053 | @item C-Mouse-1 | ||
| 1054 | Enable or disable a breakpoint. | ||
| 1055 | |||
| 1056 | @item Mouse-3 | ||
| 1057 | Continue execution to here. | ||
| 1058 | |||
| 1059 | @item C-Mouse-3 | ||
| 1060 | Jump 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 |