diff options
| author | Dmitry Dzhus | 2009-08-08 17:00:52 +0000 |
|---|---|---|
| committer | Dmitry Dzhus | 2009-08-08 17:00:52 +0000 |
| commit | 8d6bb99e733acf952a9e43a47e3e7ef48ca1f31c (patch) | |
| tree | 9957c265bd2c5b6bd8057648f3702166cf085ed7 | |
| parent | 7c4654ad3b6d5c286138a270057716b01e4edd18 (diff) | |
| download | emacs-8d6bb99e733acf952a9e43a47e3e7ef48ca1f31c.tar.gz emacs-8d6bb99e733acf952a9e43a47e3e7ef48ca1f31c.zip | |
* emacs.texi (Top): Add new menu items for GDB-UI.
* building.texi (GDB Graphical Interface): Add Multithreaded debugging
section. Threads buffer is in separate section now.
| -rw-r--r-- | doc/emacs/ChangeLog | 7 | ||||
| -rw-r--r-- | doc/emacs/building.texi | 219 | ||||
| -rw-r--r-- | doc/emacs/emacs.texi | 18 |
3 files changed, 213 insertions, 31 deletions
diff --git a/doc/emacs/ChangeLog b/doc/emacs/ChangeLog index 10146756367..8d51f84e899 100644 --- a/doc/emacs/ChangeLog +++ b/doc/emacs/ChangeLog | |||
| @@ -1,3 +1,10 @@ | |||
| 1 | 2009-08-08 Dmitry Dzhus <dima@sphinx.net.ru> | ||
| 2 | |||
| 3 | * emacs.texi (Top): Add new menu items for GDB-UI. | ||
| 4 | |||
| 5 | * building.texi (GDB Graphical Interface): Add Multithreaded debugging | ||
| 6 | section. Threads buffer is in separate section now. | ||
| 7 | |||
| 1 | 2009-08-08 Glenn Morris <rgm@gnu.org> | 8 | 2009-08-08 Glenn Morris <rgm@gnu.org> |
| 2 | 9 | ||
| 3 | * ack.texi (Acknowledgments): | 10 | * ack.texi (Acknowledgments): |
diff --git a/doc/emacs/building.texi b/doc/emacs/building.texi index 2eb714b826d..62036baceca 100644 --- a/doc/emacs/building.texi +++ b/doc/emacs/building.texi | |||
| @@ -854,10 +854,12 @@ multiple programs within one Emacs session. | |||
| 854 | * Source Buffers:: Use the mouse in the fringe/margin to | 854 | * Source Buffers:: Use the mouse in the fringe/margin to |
| 855 | control your program. | 855 | control your program. |
| 856 | * Breakpoints Buffer:: A breakpoint control panel. | 856 | * Breakpoints Buffer:: A breakpoint control panel. |
| 857 | * Threads Buffer:: Displays your threads. | ||
| 857 | * Stack Buffer:: Select a frame from the call stack. | 858 | * Stack Buffer:: Select a frame from the call stack. |
| 858 | * Other GDB-UI Buffers:: Input/output, locals, registers, | 859 | * Other GDB-UI Buffers:: Input/output, locals, registers, |
| 859 | assembler, threads and memory buffers. | 860 | assembler, threads and memory buffers. |
| 860 | * Watch Expressions:: Monitor variable values in the speedbar. | 861 | * Watch Expressions:: Monitor variable values in the speedbar. |
| 862 | * Multithreaded Debugging:: Debugging programs with several threads. | ||
| 861 | @end menu | 863 | @end menu |
| 862 | 864 | ||
| 863 | @node GDB-UI Layout | 865 | @node GDB-UI Layout |
| @@ -882,7 +884,7 @@ displays the following frame layout: | |||
| 882 | |--------------------------------+--------------------------------+ | 884 | |--------------------------------+--------------------------------+ |
| 883 | | Primary Source buffer | I/O buffer for debugged pgm | | 885 | | Primary Source buffer | I/O buffer for debugged pgm | |
| 884 | |--------------------------------+--------------------------------+ | 886 | |--------------------------------+--------------------------------+ |
| 885 | | Stack buffer | Breakpoints/thread buffer | | 887 | | Stack buffer | Breakpoints/Thread buffer | |
| 886 | +--------------------------------+--------------------------------+ | 888 | +--------------------------------+--------------------------------+ |
| 887 | @end group | 889 | @end group |
| 888 | @end smallexample | 890 | @end smallexample |
| @@ -903,7 +905,7 @@ gdb-many-windows}. | |||
| 903 | 905 | ||
| 904 | You may also specify additional GDB-related buffers to display, | 906 | You may also specify additional GDB-related buffers to display, |
| 905 | either in the same frame or a different one. Select the buffers you | 907 | either in the same frame or a different one. Select the buffers you |
| 906 | want with the @samp{GUD->GDB-windows} and @samp{GUD->GDB-Frames} | 908 | want with the @samp{GUD->GDB-Windows} and @samp{GUD->GDB-Frames} |
| 907 | sub-menus. If the menu-bar is unavailable, type @code{M-x | 909 | sub-menus. If the menu-bar is unavailable, type @code{M-x |
| 908 | gdb-display-@var{buffertype}-buffer} or @code{M-x | 910 | gdb-display-@var{buffertype}-buffer} or @code{M-x |
| 909 | gdb-frame-@var{buffertype}-buffer} respectively, where | 911 | gdb-frame-@var{buffertype}-buffer} respectively, where |
| @@ -1010,10 +1012,50 @@ Visit the source line for the current breakpoint | |||
| 1010 | Visit the source line for the breakpoint you click on. | 1012 | Visit the source line for the breakpoint you click on. |
| 1011 | @end table | 1013 | @end table |
| 1012 | 1014 | ||
| 1015 | @vindex gdb-show-threads-by-default | ||
| 1013 | When @code{gdb-many-windows} is non-@code{nil}, the breakpoints buffer | 1016 | When @code{gdb-many-windows} is non-@code{nil}, the breakpoints buffer |
| 1014 | shares its window with the threads buffer. To switch from one to the | 1017 | shares its window with the threads buffer. To switch from one to the |
| 1015 | other click with @kbd{mouse-1} on the relevant button in the header | 1018 | other click with @kbd{Mouse-1} on the relevant button in the header |
| 1016 | line. | 1019 | line, or press @kbd{TAB} inside that buffer. When |
| 1020 | @code{gdb-show-threads-by-default} is non-@code{nil}, threads buffer | ||
| 1021 | is shown in place of breakpoints buffer by default. | ||
| 1022 | |||
| 1023 | @node Threads Buffer | ||
| 1024 | @subsubsection Threads Buffer | ||
| 1025 | |||
| 1026 | @findex gdb-select-thread | ||
| 1027 | The threads buffer displays a summary of all threads currently in your | ||
| 1028 | program (@pxref{Threads, Threads, Debugging programs with multiple | ||
| 1029 | threads, gdb, The GNU debugger}). Move point to any thread in the list | ||
| 1030 | and press @key{RET} to select it (@code{gdb-select-thread}) and | ||
| 1031 | display the associated source in the primary source buffer. | ||
| 1032 | Alternatively, click @kbd{Mouse-2} on a thread to select it. Contents | ||
| 1033 | of all GDB buffers are updated whenever you select a thread. | ||
| 1034 | |||
| 1035 | You can customize variables under @code{gdb-buffers} group to select | ||
| 1036 | fields included in threads buffer. | ||
| 1037 | |||
| 1038 | @table @code | ||
| 1039 | @item gdb-thread-buffer-verbose-names | ||
| 1040 | @vindex gdb-thread-buffer-verbose-names | ||
| 1041 | Show long thread names like @samp{Thread 0x4e2ab70 (LWP 1983)} in | ||
| 1042 | threads buffer. | ||
| 1043 | |||
| 1044 | @item gdb-thread-buffer-arguments | ||
| 1045 | @vindex gdb-thread-buffer-arguments | ||
| 1046 | Show arguments of thread top frames in threads buffer. | ||
| 1047 | |||
| 1048 | @item gdb-thread-buffer-locations | ||
| 1049 | @vindex gdb-thread-buffer-locations | ||
| 1050 | Show file information or library names in threads buffer. | ||
| 1051 | |||
| 1052 | @item gdb-thread-buffer-addresses | ||
| 1053 | @vindex gdb-thread-buffer-addresses | ||
| 1054 | Show addresses for thread frames in threads buffer. | ||
| 1055 | @end table | ||
| 1056 | |||
| 1057 | Several other commands are available in threads buffer to assist in | ||
| 1058 | debugging multithreaded programs (@pxref{Multithreaded Debugging}). | ||
| 1017 | 1059 | ||
| 1018 | @node Stack Buffer | 1060 | @node Stack Buffer |
| 1019 | @subsubsection Stack Buffer | 1061 | @subsubsection Stack Buffer |
| @@ -1069,27 +1111,12 @@ With GDB 6.4 or later, recently changed register values display with | |||
| 1069 | press @key{SPC} to toggle the display of floating point registers | 1111 | press @key{SPC} to toggle the display of floating point registers |
| 1070 | (@code{toggle-gdb-all-registers}). | 1112 | (@code{toggle-gdb-all-registers}). |
| 1071 | 1113 | ||
| 1072 | @item Assembler Buffer | 1114 | @item Disassembly Buffer |
| 1073 | The assembler buffer displays the current frame as machine code. An | 1115 | The disassembly buffer displays the current frame as machine code. An |
| 1074 | arrow points to the current instruction, and you can set and remove | 1116 | arrow points to the current instruction, and you can set and remove |
| 1075 | breakpoints as in a source buffer. Breakpoint icons also appear in | 1117 | breakpoints as in a source buffer. Breakpoint icons also appear in |
| 1076 | the fringe or margin. | 1118 | the fringe or margin. |
| 1077 | 1119 | ||
| 1078 | @item Threads Buffer | ||
| 1079 | @findex gdb-threads-select | ||
| 1080 | The threads buffer displays a summary of all threads currently in your | ||
| 1081 | program (@pxref{Threads, Threads, Debugging programs with multiple | ||
| 1082 | threads, gdb, The GNU debugger}). Move point to any thread in the | ||
| 1083 | list and press @key{RET} to select it (@code{gdb-threads-select}) and | ||
| 1084 | display the associated source in the primary source buffer. | ||
| 1085 | Alternatively, click @kbd{Mouse-2} on a thread to select it. If the | ||
| 1086 | locals buffer is visible, its contents update to display the variables | ||
| 1087 | that are local in the new thread. | ||
| 1088 | |||
| 1089 | When there is more than one main thread and the threads buffer is | ||
| 1090 | present, Emacs displays the selected thread number in the mode line of | ||
| 1091 | many of the GDB-UI Buffers. | ||
| 1092 | |||
| 1093 | @item Memory Buffer | 1120 | @item Memory Buffer |
| 1094 | The memory buffer lets you examine sections of program memory | 1121 | The memory buffer lets you examine sections of program memory |
| 1095 | (@pxref{Memory, Memory, Examining memory, gdb, The GNU debugger}). | 1122 | (@pxref{Memory, Memory, Examining memory, gdb, The GNU debugger}). |
| @@ -1102,8 +1129,9 @@ size for these data items. | |||
| 1102 | 1129 | ||
| 1103 | When @code{gdb-many-windows} is non-@code{nil}, the threads buffer | 1130 | When @code{gdb-many-windows} is non-@code{nil}, the threads buffer |
| 1104 | shares its window with the breakpoints buffer, and the locals buffer | 1131 | shares its window with the breakpoints buffer, and the locals buffer |
| 1105 | with the registers buffer. To switch from one to the other click with | 1132 | with the registers buffer. To switch from one to the other click with |
| 1106 | @kbd{mouse-1} on the relevant button in the header line. | 1133 | @kbd{Mouse-1} on the relevant button in the header line or press |
| 1134 | @kbd{TAB} inside the buffer. | ||
| 1107 | 1135 | ||
| 1108 | @node Watch Expressions | 1136 | @node Watch Expressions |
| 1109 | @subsubsection Watch Expressions | 1137 | @subsubsection Watch Expressions |
| @@ -1171,6 +1199,151 @@ expressions updates, set @code{gdb-speedbar-auto-raise} to | |||
| 1171 | non-@code{nil}. This can be useful if you are debugging with a full | 1199 | non-@code{nil}. This can be useful if you are debugging with a full |
| 1172 | screen Emacs frame. | 1200 | screen Emacs frame. |
| 1173 | 1201 | ||
| 1202 | @node Multithreaded Debugging | ||
| 1203 | @subsubsection Multithreaded Debugging | ||
| 1204 | @cindex Multithreaded debugging in GDB | ||
| 1205 | |||
| 1206 | Features described in this node are supported only by GDB 7.0. | ||
| 1207 | |||
| 1208 | @subsubheading Non-stop Debugging | ||
| 1209 | @cindex Non-stop debugging in GDB | ||
| 1210 | |||
| 1211 | For some multithreaded targets, GDB allows debugging in | ||
| 1212 | @dfn{non-stop mode}. If non-stop mode is activated, when one thread | ||
| 1213 | stops, the rest continue to execute, as opposed to traditional | ||
| 1214 | @dfn{all-stop mode}, in which stopping of one thread causes @emph{all} | ||
| 1215 | threads to stop. @xref{Non-Stop Mode, , Non-Stop Mode, gdb, The GNU | ||
| 1216 | debugger}. | ||
| 1217 | |||
| 1218 | @vindex gdb-non-stop-setting | ||
| 1219 | To activate non-stop debugging in Emacs, set | ||
| 1220 | @code{gdb-non-stop-setting} variable to non-@code{nil}. Note that GDB | ||
| 1221 | debugging session needs to be restarted for change of this setting to | ||
| 1222 | take effect. | ||
| 1223 | |||
| 1224 | @vindex gdb-switch-when-another-stopped | ||
| 1225 | When a thread stops in non-stop mode, Emacs automatically switches to | ||
| 1226 | that thread. It may be undesirable to allow switching of current | ||
| 1227 | thread when some other stopped thread is already selected. Set | ||
| 1228 | @code{gdb-switch-when-another-stopped} to @code{nil} to prevent this. | ||
| 1229 | |||
| 1230 | @vindex gdb-switch-reasons | ||
| 1231 | Emacs can decide whether or not to switch to stopped thread depending | ||
| 1232 | on the reason which caused the stop. Customize | ||
| 1233 | @code{gdb-switch-reasons} to select stop reasons which make Emacs | ||
| 1234 | switch thread. | ||
| 1235 | |||
| 1236 | @vindex gdb-stopped-hooks | ||
| 1237 | @code{gdb-stopped-hooks} hook variable allows you to execute your | ||
| 1238 | functions whenever some thread stops. | ||
| 1239 | |||
| 1240 | In non-stop mode, you can switch between different modes for GUD | ||
| 1241 | execution control commands. | ||
| 1242 | |||
| 1243 | @vindex gdb-gud-control-all-threads | ||
| 1244 | @table @dfn | ||
| 1245 | @item Non-stop/A | ||
| 1246 | |||
| 1247 | When @code{gdb-gud-control-all-threads} is @code{t} (that’s default), | ||
| 1248 | interruption & continuation commands apply to all threads, so you can | ||
| 1249 | halt or continue all your threads with one command | ||
| 1250 | (@code{gud-stop-subjob} and @code{gud-cont}, respectively). @samp{Go} | ||
| 1251 | button is shown on the toolbar when at least one thread is stopped, | ||
| 1252 | whereas @samp{Stop} button is shown when at least one thread is | ||
| 1253 | running. | ||
| 1254 | |||
| 1255 | @item Non-stop/T | ||
| 1256 | |||
| 1257 | When @code{gdb-gud-control-all-threads} is @code{nil}, only current | ||
| 1258 | thread is stopped/continued. @samp{Go} and @samp{Stop} buttons on | ||
| 1259 | the GUD toolbar are shown depending on the state of current thread. | ||
| 1260 | @end table | ||
| 1261 | |||
| 1262 | You can change the current value of @code{gdb-gud-control-all-threads} | ||
| 1263 | from @samp{GUD->GDB-MI} menu. | ||
| 1264 | |||
| 1265 | Stepping commands always apply to current thread. | ||
| 1266 | |||
| 1267 | @subsubheading Observing Several Threads Simultaneously | ||
| 1268 | @cindex Observing several threads simultaneously in GDB | ||
| 1269 | |||
| 1270 | It’s possible to observe information for several threads | ||
| 1271 | simultaneously (in addition to buffers which show information for | ||
| 1272 | currently selected thread) using the following keys from the threads | ||
| 1273 | buffer. | ||
| 1274 | |||
| 1275 | @table @key | ||
| 1276 | @item d | ||
| 1277 | @kindex d @r{(GDB threads buffer)} | ||
| 1278 | @findex gdb-display-disassembly-for-thread | ||
| 1279 | Display disassembly buffer for the thread at current line. | ||
| 1280 | (@code{gdb-display-disassembly-for-thread}) | ||
| 1281 | |||
| 1282 | @item f | ||
| 1283 | @kindex f @r{(GDB threads buffer)} | ||
| 1284 | @findex gdb-display-stack-for-thread | ||
| 1285 | Display stack buffer for the thread at current line. | ||
| 1286 | (@code{gdb-display-stack-for-thread}). | ||
| 1287 | |||
| 1288 | @item l | ||
| 1289 | @kindex l @r{(GDB threads buffer)} | ||
| 1290 | @findex gdb-display-locals-for-thread | ||
| 1291 | Display locals buffer for the thread at current line. | ||
| 1292 | (@code{gdb-display-locals-for-thread}). | ||
| 1293 | |||
| 1294 | @item r | ||
| 1295 | @kindex r @r{(GDB threads buffer)} | ||
| 1296 | @findex gdb-display-registers-for-thread | ||
| 1297 | Display registers buffer for the thread at current line. | ||
| 1298 | (@code{gdb-display-registers-for-thread}). | ||
| 1299 | |||
| 1300 | @item D | ||
| 1301 | @kindex D @r{(GDB threads buffer)} | ||
| 1302 | @findex gdb-frame-disassembly-for-thread | ||
| 1303 | Display a new frame with disassembly buffer for the thread at current | ||
| 1304 | line. (@code{gdb-frame-disassembly-for-thread}). | ||
| 1305 | |||
| 1306 | @item F | ||
| 1307 | @kindex F @r{(GDB threads buffer)} | ||
| 1308 | @findex gdb-frame-stack-for-thread | ||
| 1309 | Display a new frame with stack buffer for the thread at current line. | ||
| 1310 | (@code{gdb-frame-stack-for-thread}). | ||
| 1311 | |||
| 1312 | @item L | ||
| 1313 | @kindex L @r{(GDB threads buffer)} | ||
| 1314 | @findex gdb-frame-locals-for-thread | ||
| 1315 | Display a new frame with locals buffer for the thread at current line. | ||
| 1316 | (@code{gdb-frame-locals-for-thread}). | ||
| 1317 | |||
| 1318 | @item R | ||
| 1319 | @kindex R @r{(GDB threads buffer)} | ||
| 1320 | @findex gdb-frame-registers-for-thread | ||
| 1321 | Display a new frame with registers buffer for the thread at current | ||
| 1322 | line. (@code{gdb-frame-registers-for-thread}). | ||
| 1323 | @end table | ||
| 1324 | |||
| 1325 | When you create a buffer showing information about some specific | ||
| 1326 | thread, it becomes bound to that thread and keeps showing actual | ||
| 1327 | information while you debug your program. Every GDB buffer contains a | ||
| 1328 | number of thread it shows information for in its mode name. Thread | ||
| 1329 | number is also included in the buffer name of bound buffers to prevent | ||
| 1330 | buffer names clashing. | ||
| 1331 | |||
| 1332 | @subsubheading Fine Thread Control | ||
| 1333 | |||
| 1334 | In non-stop mode, you can interrupt/continue your threads without | ||
| 1335 | selecting them. Hitting @key{i} in threads buffer interrupts thread | ||
| 1336 | under point, @key{c} continues it, @key{s} steps through. More such | ||
| 1337 | commands may be added in the future. | ||
| 1338 | |||
| 1339 | Combined with creating bound buffers for any thread, this allows you | ||
| 1340 | to change and track state of many threads in the same time. | ||
| 1341 | |||
| 1342 | Note that when you interrupt a thread, it stops with @samp{signal | ||
| 1343 | received} reason. If that reason is included in your | ||
| 1344 | @code{gdb-switch-reasons} (it is by default), Emacs will switch to | ||
| 1345 | that thread. | ||
| 1346 | |||
| 1174 | @node Executing Lisp | 1347 | @node Executing Lisp |
| 1175 | @section Executing Lisp Expressions | 1348 | @section Executing Lisp Expressions |
| 1176 | 1349 | ||
diff --git a/doc/emacs/emacs.texi b/doc/emacs/emacs.texi index 95f73b52711..c875cb9a8fa 100644 --- a/doc/emacs/emacs.texi +++ b/doc/emacs/emacs.texi | |||
| @@ -744,14 +744,16 @@ Running Debuggers Under Emacs | |||
| 744 | 744 | ||
| 745 | GDB Graphical Interface | 745 | GDB Graphical Interface |
| 746 | 746 | ||
| 747 | * GDB-UI Layout:: Control the number of displayed buffers. | 747 | * GDB-UI Layout:: Control the number of displayed buffers. |
| 748 | * Source Buffers:: Use the mouse in the fringe/margin to | 748 | * Source Buffers:: Use the mouse in the fringe/margin to |
| 749 | control your program. | 749 | control your program. |
| 750 | * Breakpoints Buffer:: A breakpoint control panel. | 750 | * Breakpoints Buffer:: A breakpoint control panel. |
| 751 | * Stack Buffer:: Select a frame from the call stack. | 751 | * Threads Buffer:: Displays your threads. |
| 752 | * Other GDB-UI Buffers::Input/output, locals, registers, | 752 | * Stack Buffer:: Select a frame from the call stack. |
| 753 | assembler, threads and memory buffers. | 753 | * Other GDB-UI Buffers:: Input/output, locals, registers, |
| 754 | * Watch Expressions:: Monitor variable values in the speedbar. | 754 | assembler, threads and memory buffers. |
| 755 | * Watch Expressions:: Monitor variable values in the speedbar. | ||
| 756 | * Multithreaded Debugging:: Debugging programs with several threads. | ||
| 755 | 757 | ||
| 756 | Maintaining Large Programs | 758 | Maintaining Large Programs |
| 757 | 759 | ||