Mercurial > emacs
comparison man/building.texi @ 71253:72b7de925c8d
(Watch Expressions): Move node to end.
(GDB Graphical Interface): Move description of clicks in fringe...
(GDB commands in the Fringe): ...to here. New node.
author | Nick Roberts <nickrob@snap.net.nz> |
---|---|
date | Tue, 06 Jun 2006 23:16:32 +0000 |
parents | 31d9cfc257a4 |
children | 4d628cade603 a8190f7e546e |
comparison
equal
deleted
inserted
replaced
71252:de5774b55f7f | 71253:72b7de925c8d |
---|---|
805 | 805 |
806 By default, the command @code{gdb} starts GDB using a graphical | 806 By default, the command @code{gdb} starts GDB using a graphical |
807 interface, using Emacs windows for display program state information. | 807 interface, using Emacs windows for display program state information. |
808 In effect, this makes Emacs into an IDE (interactive development | 808 In effect, this makes Emacs into an IDE (interactive development |
809 environment). With it, you do not need to use textual GDB commands; | 809 environment). With it, you do not need to use textual GDB commands; |
810 you can control the debugging session with the mouse. | 810 you can control the debugging session with the mouse. For example, |
811 | 811 you can click in the fringe of a source buffer to set a breakpoint |
812 @c @findex gdb-mouse-set-clear-breakpoint | 812 there, or on a stack frame in the stack buffer to select that frame. |
813 @c @findex gdb-mouse-toggle-breakpoint | |
814 For example, you can click @kbd{Mouse-1} in the fringe or display | |
815 margin of a source buffer to set a breakpoint there and, on a | |
816 graphical display, a red bullet will appear on that line. If a | |
817 breakpoint already exists on that line, the same click will remove it. | |
818 You can also enable or disable a breakpoint by clicking @kbd{C-Mouse-1} | |
819 on the bullet. If you drag the debugger arrow in the fringe with | |
820 @kbd{Mouse-1} (@code{gdb-mouse-until}), execution will continue to the | |
821 line where you release the button, provided it is still in the same | |
822 frame. Alternatively, you can click @kbd{Mouse-3} at some point in | |
823 the fringe of this buffer and execution will advance to there. | |
824 | 813 |
825 This mode requires telling GDB that its ``screen size'' is | 814 This mode requires telling GDB that its ``screen size'' is |
826 unlimited, so it sets the height and width accordingly. For correct | 815 unlimited, so it sets the height and width accordingly. For correct |
827 operation you must not change these values during the GDB session. | 816 operation you must not change these values during the GDB session. |
828 | 817 |
837 | 826 |
838 @menu | 827 @menu |
839 * GDB User Interface Layout:: Control the number of displayed buffers. | 828 * GDB User Interface Layout:: Control the number of displayed buffers. |
840 * Breakpoints Buffer:: A breakpoint control panel. | 829 * Breakpoints Buffer:: A breakpoint control panel. |
841 * Stack Buffer:: Select a frame from the call stack. | 830 * Stack Buffer:: Select a frame from the call stack. |
842 * Watch Expressions:: Monitor variable values in the speedbar. | |
843 * Other GDB User Interface Buffers:: Input/output, locals, registers, | 831 * Other GDB User Interface Buffers:: Input/output, locals, registers, |
844 assembler, threads and memory buffers. | 832 assembler, threads and memory buffers. |
833 * GDB commands in the Fringe:: Use the mouse in the fringe/margin to | |
834 control your program. | |
835 * Watch Expressions:: Monitor variable values in the speedbar. | |
845 @end menu | 836 @end menu |
846 | 837 |
847 @node GDB User Interface Layout | 838 @node GDB User Interface Layout |
848 @subsubsection GDB User Interface Layout | 839 @subsubsection GDB User Interface Layout |
849 @cindex GDB User Interface layout | 840 @cindex GDB User Interface layout |
956 frame and type @key{RET} (@code{gdb-frames-select}), or click | 947 frame and type @key{RET} (@code{gdb-frames-select}), or click |
957 @kbd{Mouse-2} on a stack frame. If the locals buffer is visible, | 948 @kbd{Mouse-2} on a stack frame. If the locals buffer is visible, |
958 selecting a stack frame updates it to display the local variables of | 949 selecting a stack frame updates it to display the local variables of |
959 the new frame. | 950 the new frame. |
960 | 951 |
961 @node Watch Expressions | |
962 @subsubsection Watch Expressions | |
963 @cindex Watching expressions in GDB | |
964 | |
965 @findex gud-watch | |
966 @kindex C-x C-a C-w @r{(GUD)} | |
967 If you want to see how a variable changes each time your program | |
968 stops, move point into the variable name and click on the watch icon | |
969 in the tool bar (@code{gud-watch}) or type @kbd{C-x C-a C-w}. If you | |
970 specify a prefix argument, you can enter the variable name in the | |
971 minibuffer. | |
972 | |
973 Each watch expression is displayed in the speedbar. Complex data | |
974 types, such as arrays, structures and unions are represented in a tree | |
975 format. Leaves and simple data types show the name of the expression | |
976 and its value and, when the speedbar frame is selected, display the | |
977 type as a tooltip. Higher levels show the name, type and address | |
978 value for pointers and just the name and type otherwise. Root expressions | |
979 also display the frame address as a tooltip to help identify the frame | |
980 in which they were defined. | |
981 | |
982 To expand or contract a complex data type, click @kbd{Mouse-2} | |
983 on the tag to the left of the expression. | |
984 | |
985 @kindex D @r{(GDB speedbar)} | |
986 @findex gdb-var-delete | |
987 To delete a complex watch expression, move point to the root | |
988 expression in the speedbar and type @kbd{D} (@code{gdb-var-delete}). | |
989 | |
990 @kindex RET @r{(GDB speedbar)} | |
991 @findex gdb-edit-value | |
992 To edit a variable with a simple data type, or a simple element of a | |
993 complex data type, move point there in the speedbar and type @key{RET} | |
994 (@code{gdb-edit-value}). Or you can click @kbd{Mouse-2} on a value to | |
995 edit it. Either way, this reads the new value using the minibuffer. | |
996 | |
997 @vindex gdb-show-changed-values | |
998 If you set the variable @code{gdb-show-changed-values} to | |
999 non-@code{nil} (the default value), Emacs uses | |
1000 @code{font-lock-warning-face} to highlight values that have recently | |
1001 changed and @code{shadow} face to make variables which have gone out of | |
1002 scope less noticeable. When a variable goes out of scope you can't | |
1003 edit its value. | |
1004 | |
1005 @vindex gdb-use-colon-colon-notation | |
1006 If the variable @code{gdb-use-colon-colon-notation} is | |
1007 non-@code{nil}, Emacs uses the @samp{@var{function}::@var{variable}} | |
1008 format. This allows the user to display watch expressions which share | |
1009 the same variable name. The default value is @code{nil}. | |
1010 | |
1011 @vindex gdb-speedbar-auto-raise | |
1012 To automatically raise the speedbar every time the display of watch | |
1013 expressions updates, set @code{gdb-speedbar-auto-raise} to | |
1014 non-@code{nil}. This can be useful if you are debugging with a full | |
1015 screen Emacs frame. | |
1016 | |
1017 @node Other GDB User Interface Buffers | 952 @node Other GDB User Interface Buffers |
1018 @subsubsection Other Buffers | 953 @subsubsection Other Buffers |
1019 | 954 |
1020 @table @asis | 955 @table @asis |
1021 @item Input/Output Buffer | 956 @item Input/Output Buffer |
1074 (@pxref{Memory, Memory, Examining memory, gdb, The GNU debugger}). | 1009 (@pxref{Memory, Memory, Examining memory, gdb, The GNU debugger}). |
1075 Click @kbd{Mouse-1} on the appropriate part of the header line to | 1010 Click @kbd{Mouse-1} on the appropriate part of the header line to |
1076 change the starting address or number of data items that the buffer | 1011 change the starting address or number of data items that the buffer |
1077 displays. Click @kbd{Mouse-3} on the header line to select the | 1012 displays. Click @kbd{Mouse-3} on the header line to select the |
1078 display format or unit size for these data items. | 1013 display format or unit size for these data items. |
1079 | |
1080 @end table | 1014 @end table |
1015 | |
1016 @node GDB commands in the Fringe | |
1017 @subsubsection GDB commands in the Fringe | |
1018 @cindex GDB commands in the Fringe | |
1019 | |
1020 @c @findex gdb-mouse-set-clear-breakpoint | |
1021 @c @findex gdb-mouse-toggle-breakpoint | |
1022 Many GDB commands can be entered using keybindings or the tool bar but | |
1023 sometimes it is quicker to use the fringe. These commands either | |
1024 manipulate breakpoints or control program execution. When there is no | |
1025 fringe, you can use the margin but this is only present when the | |
1026 source file already has a breakpoint. | |
1027 | |
1028 You can click @kbd{Mouse-1} in the fringe or display margin of a | |
1029 source buffer to set a breakpoint there and, on a graphical display, a | |
1030 red bullet will appear on that line. If a breakpoint already exists | |
1031 on that line, the same click will remove it. You can also enable or | |
1032 disable a breakpoint by clicking @kbd{C-Mouse-1} on the bullet. | |
1033 | |
1034 If you drag the debugger arrow in the fringe with @kbd{Mouse-1} | |
1035 (@code{gdb-mouse-until}), execution will continue to the line where | |
1036 you release the button, provided it is still in the same frame. | |
1037 Alternatively, you can click @kbd{Mouse-3} at some point in the fringe | |
1038 of this buffer and execution will advance to there. A similar command | |
1039 (@code{gdb-mouse-jump}) allows you to jump to a source line without | |
1040 executing the intermediate lines by clicking @kbd{C-Mouse-3}. This | |
1041 command allows you to go backwards which can be useful for running | |
1042 through code that has already executed, in order to examine its | |
1043 execution in more detail. | |
1044 | |
1045 @table @kbd | |
1046 @item Mouse-1 | |
1047 Set or clear a breakpoint. | |
1048 | |
1049 @item C-Mouse-1 | |
1050 Enable or disable a breakpoint. | |
1051 | |
1052 @item Mouse-3 | |
1053 Continue execution to here. | |
1054 | |
1055 @item C-Mouse-3 | |
1056 Jump to here. | |
1057 @end table | |
1058 | |
1059 @node Watch Expressions | |
1060 @subsubsection Watch Expressions | |
1061 @cindex Watching expressions in GDB | |
1062 | |
1063 @findex gud-watch | |
1064 @kindex C-x C-a C-w @r{(GUD)} | |
1065 If you want to see how a variable changes each time your program | |
1066 stops, move point into the variable name and click on the watch icon | |
1067 in the tool bar (@code{gud-watch}) or type @kbd{C-x C-a C-w}. If you | |
1068 specify a prefix argument, you can enter the variable name in the | |
1069 minibuffer. | |
1070 | |
1071 Each watch expression is displayed in the speedbar. Complex data | |
1072 types, such as arrays, structures and unions are represented in a tree | |
1073 format. Leaves and simple data types show the name of the expression | |
1074 and its value and, when the speedbar frame is selected, display the | |
1075 type as a tooltip. Higher levels show the name, type and address | |
1076 value for pointers and just the name and type otherwise. Root expressions | |
1077 also display the frame address as a tooltip to help identify the frame | |
1078 in which they were defined. | |
1079 | |
1080 To expand or contract a complex data type, click @kbd{Mouse-2} | |
1081 on the tag to the left of the expression. | |
1082 | |
1083 @kindex D @r{(GDB speedbar)} | |
1084 @findex gdb-var-delete | |
1085 To delete a complex watch expression, move point to the root | |
1086 expression in the speedbar and type @kbd{D} (@code{gdb-var-delete}). | |
1087 | |
1088 @kindex RET @r{(GDB speedbar)} | |
1089 @findex gdb-edit-value | |
1090 To edit a variable with a simple data type, or a simple element of a | |
1091 complex data type, move point there in the speedbar and type @key{RET} | |
1092 (@code{gdb-edit-value}). Or you can click @kbd{Mouse-2} on a value to | |
1093 edit it. Either way, this reads the new value using the minibuffer. | |
1094 | |
1095 @vindex gdb-show-changed-values | |
1096 If you set the variable @code{gdb-show-changed-values} to | |
1097 non-@code{nil} (the default value), Emacs uses | |
1098 @code{font-lock-warning-face} to highlight values that have recently | |
1099 changed and @code{shadow} face to make variables which have gone out of | |
1100 scope less noticeable. When a variable goes out of scope you can't | |
1101 edit its value. | |
1102 | |
1103 @vindex gdb-use-colon-colon-notation | |
1104 If the variable @code{gdb-use-colon-colon-notation} is | |
1105 non-@code{nil}, Emacs uses the @samp{@var{function}::@var{variable}} | |
1106 format. This allows the user to display watch expressions which share | |
1107 the same variable name. The default value is @code{nil}. | |
1108 | |
1109 @vindex gdb-speedbar-auto-raise | |
1110 To automatically raise the speedbar every time the display of watch | |
1111 expressions updates, set @code{gdb-speedbar-auto-raise} to | |
1112 non-@code{nil}. This can be useful if you are debugging with a full | |
1113 screen Emacs frame. | |
1081 | 1114 |
1082 @node Executing Lisp | 1115 @node Executing Lisp |
1083 @section Executing Lisp Expressions | 1116 @section Executing Lisp Expressions |
1084 | 1117 |
1085 Emacs has several different major modes for Lisp and Scheme. They are | 1118 Emacs has several different major modes for Lisp and Scheme. They are |