diff options
| author | Nick Roberts | 2009-08-31 03:52:29 +0000 |
|---|---|---|
| committer | Nick Roberts | 2009-08-31 03:52:29 +0000 |
| commit | 254bb2e698841d2962def44f1ee9d6849cd67197 (patch) | |
| tree | da4a3c166bb19b37c35c3834903817ef182f3c78 | |
| parent | 0e1cba51fd4529b7f1061b23bab7a67c48676530 (diff) | |
| download | emacs-254bb2e698841d2962def44f1ee9d6849cd67197.tar.gz emacs-254bb2e698841d2962def44f1ee9d6849cd67197.zip | |
(Threads Buffer, Multithreaded Debugging):
Re-organise these two sections,
| -rw-r--r-- | doc/emacs/building.texi | 186 |
1 files changed, 87 insertions, 99 deletions
diff --git a/doc/emacs/building.texi b/doc/emacs/building.texi index 62036baceca..a5ce5f20c7b 100644 --- a/doc/emacs/building.texi +++ b/doc/emacs/building.texi | |||
| @@ -1016,9 +1016,9 @@ Visit the source line for the breakpoint you click on. | |||
| 1016 | 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 |
| 1017 | 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 |
| 1018 | 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 |
| 1019 | line, or press @kbd{TAB} inside that buffer. When | 1019 | line, or press @kbd{TAB} inside that buffer. If |
| 1020 | @code{gdb-show-threads-by-default} is non-@code{nil}, threads buffer | 1020 | @code{gdb-show-threads-by-default} is non-@code{nil}, the threads |
| 1021 | is shown in place of breakpoints buffer by default. | 1021 | buffer, rather than the breakpoints buffer, is shown at start up. |
| 1022 | 1022 | ||
| 1023 | @node Threads Buffer | 1023 | @node Threads Buffer |
| 1024 | @subsubsection Threads Buffer | 1024 | @subsubsection Threads Buffer |
| @@ -1054,8 +1054,50 @@ Show file information or library names in threads buffer. | |||
| 1054 | Show addresses for thread frames in threads buffer. | 1054 | Show addresses for thread frames in threads buffer. |
| 1055 | @end table | 1055 | @end table |
| 1056 | 1056 | ||
| 1057 | Several other commands are available in threads buffer to assist in | 1057 | It’s possible to observe information for several threads |
| 1058 | debugging multithreaded programs (@pxref{Multithreaded Debugging}). | 1058 | simultaneously (in addition to buffers which show information for |
| 1059 | currently selected thread) using the following keys from the threads | ||
| 1060 | buffer. | ||
| 1061 | |||
| 1062 | @table @kbd | ||
| 1063 | @item d | ||
| 1064 | @kindex d @r{(GDB threads buffer)} | ||
| 1065 | @findex gdb-display-disassembly-for-thread | ||
| 1066 | Display disassembly buffer for the thread at current line. | ||
| 1067 | (@code{gdb-display-disassembly-for-thread}) | ||
| 1068 | |||
| 1069 | @item f | ||
| 1070 | @kindex f @r{(GDB threads buffer)} | ||
| 1071 | @findex gdb-display-stack-for-thread | ||
| 1072 | Display stack buffer for the thread at current line. | ||
| 1073 | (@code{gdb-display-stack-for-thread}). | ||
| 1074 | |||
| 1075 | @item l | ||
| 1076 | @kindex l @r{(GDB threads buffer)} | ||
| 1077 | @findex gdb-display-locals-for-thread | ||
| 1078 | Display locals buffer for the thread at current line. | ||
| 1079 | (@code{gdb-display-locals-for-thread}). | ||
| 1080 | |||
| 1081 | @item r | ||
| 1082 | @kindex r @r{(GDB threads buffer)} | ||
| 1083 | @findex gdb-display-registers-for-thread | ||
| 1084 | Display registers buffer for the thread at current line. | ||
| 1085 | (@code{gdb-display-registers-for-thread}). | ||
| 1086 | @end table | ||
| 1087 | |||
| 1088 | Pressing their upper-case counterparts, @kbd{D}, @kbd{F} ,@kbd{L} and | ||
| 1089 | @kbd{R} displays the corresponding buffer in a new frame. | ||
| 1090 | |||
| 1091 | When you create a buffer showing information about some specific | ||
| 1092 | thread, it becomes bound to that thread and keeps showing actual | ||
| 1093 | information while you debug your program. Every GDB buffer contains a | ||
| 1094 | number of thread it shows information for in its mode name. Thread | ||
| 1095 | number is also included in the buffer name of bound buffers to prevent | ||
| 1096 | buffer names clashing. | ||
| 1097 | |||
| 1098 | Further commands are available in the threads buffer which depend on the | ||
| 1099 | mode of GDB that is used for controlling execution of your program. | ||
| 1100 | (@pxref{Multithreaded Debugging, Stopping and Starting Multi-threaded Programs}). | ||
| 1059 | 1101 | ||
| 1060 | @node Stack Buffer | 1102 | @node Stack Buffer |
| 1061 | @subsubsection Stack Buffer | 1103 | @subsubsection Stack Buffer |
| @@ -1200,26 +1242,36 @@ non-@code{nil}. This can be useful if you are debugging with a full | |||
| 1200 | screen Emacs frame. | 1242 | screen Emacs frame. |
| 1201 | 1243 | ||
| 1202 | @node Multithreaded Debugging | 1244 | @node Multithreaded Debugging |
| 1203 | @subsubsection Multithreaded Debugging | 1245 | @subsubsection Stopping and Starting Multi-threaded Programs |
| 1204 | @cindex Multithreaded debugging in GDB | 1246 | @cindex Multithreaded debugging in GDB |
| 1205 | 1247 | ||
| 1206 | Features described in this node are supported only by GDB 7.0. | 1248 | @subsubheading All-stop Debugging |
| 1249 | |||
| 1250 | In all-stop mode, whenever your program stops, @emph{all} threads of | ||
| 1251 | execution stop. Likewise, whenever you restart the program, all | ||
| 1252 | threads start executing. @xref{All-Stop Mode, , All-Stop Mode, gdb, | ||
| 1253 | The GNU debugger}. You can enable this behaviour in Emacs by setting | ||
| 1254 | @code{gdb-non-stop-setting} to @code{nil} before starting a debugging | ||
| 1255 | session. | ||
| 1207 | 1256 | ||
| 1208 | @subsubheading Non-stop Debugging | 1257 | @subsubheading Non-stop Debugging |
| 1209 | @cindex Non-stop debugging in GDB | 1258 | @cindex Non-stop debugging in GDB |
| 1210 | 1259 | ||
| 1211 | For some multithreaded targets, GDB allows debugging in | 1260 | For some multi-threaded targets, GDB supports a further mode of |
| 1212 | @dfn{non-stop mode}. If non-stop mode is activated, when one thread | 1261 | operation in which you can examine stopped program threads in the |
| 1213 | stops, the rest continue to execute, as opposed to traditional | 1262 | debugger while other threads continue to execute freely. |
| 1214 | @dfn{all-stop mode}, in which stopping of one thread causes @emph{all} | 1263 | @xref{Non-Stop Mode, , Non-Stop Mode, gdb, The GNU debugger}. |
| 1215 | threads to stop. @xref{Non-Stop Mode, , Non-Stop Mode, gdb, The GNU | 1264 | This is referred to as @dfn{non-stop} mode. |
| 1216 | debugger}. | 1265 | |
| 1266 | Versions of GDB prior to 7.0 do not support non-stop mode and it does | ||
| 1267 | not work on all targets. In such cases, Emacs uses all-stop mode | ||
| 1268 | regardless of the value of @code{gdb-non-stop-setting}. | ||
| 1217 | 1269 | ||
| 1218 | @vindex gdb-non-stop-setting | 1270 | @vindex gdb-non-stop-setting |
| 1219 | To activate non-stop debugging in Emacs, set | 1271 | If the variable @code{gdb-non-stop-setting} is non-@code{nil} (the |
| 1220 | @code{gdb-non-stop-setting} variable to non-@code{nil}. Note that GDB | 1272 | default value), Emacs tries to start GDB in non-stop mode. Note that |
| 1221 | debugging session needs to be restarted for change of this setting to | 1273 | GDB debugging session needs to be restarted for change of this setting |
| 1222 | take effect. | 1274 | to take effect. |
| 1223 | 1275 | ||
| 1224 | @vindex gdb-switch-when-another-stopped | 1276 | @vindex gdb-switch-when-another-stopped |
| 1225 | When a thread stops in non-stop mode, Emacs automatically switches to | 1277 | When a thread stops in non-stop mode, Emacs automatically switches to |
| @@ -1228,13 +1280,13 @@ thread when some other stopped thread is already selected. Set | |||
| 1228 | @code{gdb-switch-when-another-stopped} to @code{nil} to prevent this. | 1280 | @code{gdb-switch-when-another-stopped} to @code{nil} to prevent this. |
| 1229 | 1281 | ||
| 1230 | @vindex gdb-switch-reasons | 1282 | @vindex gdb-switch-reasons |
| 1231 | Emacs can decide whether or not to switch to stopped thread depending | 1283 | Emacs can decide whether or not to switch to the stopped thread |
| 1232 | on the reason which caused the stop. Customize | 1284 | depending on the reason which caused the stop. Customize |
| 1233 | @code{gdb-switch-reasons} to select stop reasons which make Emacs | 1285 | @code{gdb-switch-reasons} to select stop reasons which make Emacs |
| 1234 | switch thread. | 1286 | switch thread. |
| 1235 | 1287 | ||
| 1236 | @vindex gdb-stopped-hooks | 1288 | @vindex gdb-stopped-hooks |
| 1237 | @code{gdb-stopped-hooks} hook variable allows you to execute your | 1289 | The variable @code{gdb-stopped-hooks} allows you to execute your |
| 1238 | functions whenever some thread stops. | 1290 | functions whenever some thread stops. |
| 1239 | 1291 | ||
| 1240 | In non-stop mode, you can switch between different modes for GUD | 1292 | In non-stop mode, you can switch between different modes for GUD |
| @@ -1244,96 +1296,32 @@ execution control commands. | |||
| 1244 | @table @dfn | 1296 | @table @dfn |
| 1245 | @item Non-stop/A | 1297 | @item Non-stop/A |
| 1246 | 1298 | ||
| 1247 | When @code{gdb-gud-control-all-threads} is @code{t} (that’s default), | 1299 | When @code{gdb-gud-control-all-threads} is @code{t} (the default |
| 1248 | interruption & continuation commands apply to all threads, so you can | 1300 | value), interruption and continuation commands apply to all threads, |
| 1249 | halt or continue all your threads with one command | 1301 | so you can halt or continue all your threads with one command using |
| 1250 | (@code{gud-stop-subjob} and @code{gud-cont}, respectively). @samp{Go} | 1302 | @code{gud-stop-subjob} and @code{gud-cont}, respectively. The |
| 1251 | button is shown on the toolbar when at least one thread is stopped, | 1303 | @samp{Go} button is shown on the toolbar when at least one thread is |
| 1252 | whereas @samp{Stop} button is shown when at least one thread is | 1304 | stopped, whereas @samp{Stop} button is shown when at least one thread |
| 1253 | running. | 1305 | is running. |
| 1254 | 1306 | ||
| 1255 | @item Non-stop/T | 1307 | @item Non-stop/T |
| 1256 | 1308 | ||
| 1257 | When @code{gdb-gud-control-all-threads} is @code{nil}, only current | 1309 | When @code{gdb-gud-control-all-threads} is @code{nil}, only the |
| 1258 | thread is stopped/continued. @samp{Go} and @samp{Stop} buttons on | 1310 | current thread is stopped/continued. @samp{Go} and @samp{Stop} |
| 1259 | the GUD toolbar are shown depending on the state of current thread. | 1311 | buttons on the GUD toolbar are shown depending on the state of current |
| 1312 | thread. | ||
| 1260 | @end table | 1313 | @end table |
| 1261 | 1314 | ||
| 1262 | You can change the current value of @code{gdb-gud-control-all-threads} | 1315 | You can change the current value of @code{gdb-gud-control-all-threads} |
| 1263 | from @samp{GUD->GDB-MI} menu. | 1316 | from the tool bar or from @samp{GUD->GDB-MI} menu. |
| 1264 | 1317 | ||
| 1265 | Stepping commands always apply to current thread. | 1318 | Stepping commands always apply to the 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 | 1319 | ||
| 1332 | @subsubheading Fine Thread Control | 1320 | @subsubheading Fine Thread Control |
| 1333 | 1321 | ||
| 1334 | In non-stop mode, you can interrupt/continue your threads without | 1322 | In non-stop mode, you can interrupt/continue your threads without |
| 1335 | selecting them. Hitting @key{i} in threads buffer interrupts thread | 1323 | selecting them. Hitting @kbd{i} in threads buffer interrupts thread |
| 1336 | under point, @key{c} continues it, @key{s} steps through. More such | 1324 | under point, @kbd{c} continues it, @kbd{s} steps through. More such |
| 1337 | commands may be added in the future. | 1325 | commands may be added in the future. |
| 1338 | 1326 | ||
| 1339 | Combined with creating bound buffers for any thread, this allows you | 1327 | Combined with creating bound buffers for any thread, this allows you |