| | 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 | |
|---|
| 963 | | the executable program that is being debugged takes its input and |
|---|
| 964 | | displays its output here. Otherwise it uses the GUD buffer for that. |
|---|
| 965 | | To toggle whether GUD mode uses this buffer, do @kbd{M-x |
|---|
| 966 | | gdb-use-separate-io-buffer}. That takes effect when you next |
|---|
| 967 | | restart the program you are debugging. |
|---|
| | 1018 | the program being debugged takes its input and displays its output |
|---|
| | 1019 | here. Otherwise it uses the GUD buffer for that. To toggle whether |
|---|
| | 1020 | GUD mode uses this buffer, do @kbd{M-x gdb-use-separate-io-buffer}. |
|---|
| | 1021 | That takes effect when you next restart the program you are debugging. |
|---|
| 1006 | | display the associated source in the source buffer. Alternatively, |
|---|
| 1007 | | click @kbd{Mouse-2} on a thread to select it. If the locals buffer is |
|---|
| 1008 | | visible, its contents update to display the variables that are local |
|---|
| 1009 | | in the new thread. |
|---|
| | 1060 | display the associated source in the primary source buffer. |
|---|
| | 1061 | Alternatively, click @kbd{Mouse-2} on a thread to select it. If the |
|---|
| | 1062 | locals buffer is visible, its contents update to display the variables |
|---|
| | 1063 | that are local in the new thread. |
|---|
| 1018 | | @end table |
|---|
| 1019 | | |
|---|
| 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. |
|---|