aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNick Roberts2009-08-31 03:52:29 +0000
committerNick Roberts2009-08-31 03:52:29 +0000
commit254bb2e698841d2962def44f1ee9d6849cd67197 (patch)
treeda4a3c166bb19b37c35c3834903817ef182f3c78
parent0e1cba51fd4529b7f1061b23bab7a67c48676530 (diff)
downloademacs-254bb2e698841d2962def44f1ee9d6849cd67197.tar.gz
emacs-254bb2e698841d2962def44f1ee9d6849cd67197.zip
(Threads Buffer, Multithreaded Debugging):
Re-organise these two sections,
-rw-r--r--doc/emacs/building.texi186
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.
1016When @code{gdb-many-windows} is non-@code{nil}, the breakpoints buffer 1016When @code{gdb-many-windows} is non-@code{nil}, the breakpoints buffer
1017shares its window with the threads buffer. To switch from one to the 1017shares its window with the threads buffer. To switch from one to the
1018other click with @kbd{Mouse-1} on the relevant button in the header 1018other click with @kbd{Mouse-1} on the relevant button in the header
1019line, or press @kbd{TAB} inside that buffer. When 1019line, 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
1021is shown in place of breakpoints buffer by default. 1021buffer, 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.
1054Show addresses for thread frames in threads buffer. 1054Show 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}). 1058simultaneously (in addition to buffers which show information for
1059currently selected thread) using the following keys from the threads
1060buffer.
1061
1062@table @kbd
1063@item d
1064@kindex d @r{(GDB threads buffer)}
1065@findex gdb-display-disassembly-for-thread
1066Display 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
1072Display 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
1078Display 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
1084Display registers buffer for the thread at current line.
1085(@code{gdb-display-registers-for-thread}).
1086@end table
1087
1088Pressing 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
1092thread, it becomes bound to that thread and keeps showing actual
1093information while you debug your program. Every GDB buffer contains a
1094number of thread it shows information for in its mode name. Thread
1095number is also included in the buffer name of bound buffers to prevent
1096buffer names clashing.
1097
1098Further commands are available in the threads buffer which depend on the
1099mode 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
1200screen Emacs frame. 1242screen 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
1250In all-stop mode, whenever your program stops, @emph{all} threads of
1251execution stop. Likewise, whenever you restart the program, all
1252threads start executing. @xref{All-Stop Mode, , All-Stop Mode, gdb,
1253The GNU debugger}. You can enable this behaviour in Emacs by setting
1254@code{gdb-non-stop-setting} to @code{nil} before starting a debugging
1255session.
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 1260For some multi-threaded targets, GDB supports a further mode of
1212@dfn{non-stop mode}. If non-stop mode is activated, when one thread 1261operation in which you can examine stopped program threads in the
1213stops, the rest continue to execute, as opposed to traditional 1262debugger 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}.
1215threads to stop. @xref{Non-Stop Mode, , Non-Stop Mode, gdb, The GNU 1264This is referred to as @dfn{non-stop} mode.
1216debugger}. 1265
1266Versions of GDB prior to 7.0 do not support non-stop mode and it does
1267not work on all targets. In such cases, Emacs uses all-stop mode
1268regardless of the value of @code{gdb-non-stop-setting}.
1217 1269
1218@vindex gdb-non-stop-setting 1270@vindex gdb-non-stop-setting
1219To activate non-stop debugging in Emacs, set 1271If 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 1272default value), Emacs tries to start GDB in non-stop mode. Note that
1221debugging session needs to be restarted for change of this setting to 1273GDB debugging session needs to be restarted for change of this setting
1222take effect. 1274to take effect.
1223 1275
1224@vindex gdb-switch-when-another-stopped 1276@vindex gdb-switch-when-another-stopped
1225When a thread stops in non-stop mode, Emacs automatically switches to 1277When 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
1231Emacs can decide whether or not to switch to stopped thread depending 1283Emacs can decide whether or not to switch to the stopped thread
1232on the reason which caused the stop. Customize 1284depending 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
1234switch thread. 1286switch 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 1289The variable @code{gdb-stopped-hooks} allows you to execute your
1238functions whenever some thread stops. 1290functions 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
1247When @code{gdb-gud-control-all-threads} is @code{t} (that’s default), 1299When @code{gdb-gud-control-all-threads} is @code{t} (the default
1248interruption & continuation commands apply to all threads, so you can 1300value), interruption and continuation commands apply to all threads,
1249halt or continue all your threads with one command 1301so 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
1251button 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
1252whereas @samp{Stop} button is shown when at least one thread is 1304stopped, whereas @samp{Stop} button is shown when at least one thread
1253running. 1305is running.
1254 1306
1255@item Non-stop/T 1307@item Non-stop/T
1256 1308
1257When @code{gdb-gud-control-all-threads} is @code{nil}, only current 1309When @code{gdb-gud-control-all-threads} is @code{nil}, only the
1258thread is stopped/continued. @samp{Go} and @samp{Stop} buttons on 1310current thread is stopped/continued. @samp{Go} and @samp{Stop}
1259the GUD toolbar are shown depending on the state of current thread. 1311buttons on the GUD toolbar are shown depending on the state of current
1312thread.
1260@end table 1313@end table
1261 1314
1262You can change the current value of @code{gdb-gud-control-all-threads} 1315You can change the current value of @code{gdb-gud-control-all-threads}
1263from @samp{GUD->GDB-MI} menu. 1316from 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
1271simultaneously (in addition to buffers which show information for
1272currently selected thread) using the following keys from the threads
1273buffer.
1274
1275@table @key
1276@item d
1277@kindex d @r{(GDB threads buffer)}
1278@findex gdb-display-disassembly-for-thread
1279Display 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
1285Display 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
1291Display 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
1297Display 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
1303Display a new frame with disassembly buffer for the thread at current
1304line. (@code{gdb-frame-disassembly-for-thread}).
1305
1306@item F
1307@kindex F @r{(GDB threads buffer)}
1308@findex gdb-frame-stack-for-thread
1309Display 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
1315Display 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
1321Display a new frame with registers buffer for the thread at current
1322line. (@code{gdb-frame-registers-for-thread}).
1323@end table
1324
1325 When you create a buffer showing information about some specific
1326thread, it becomes bound to that thread and keeps showing actual
1327information while you debug your program. Every GDB buffer contains a
1328number of thread it shows information for in its mode name. Thread
1329number is also included in the buffer name of bound buffers to prevent
1330buffer 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
1335selecting them. Hitting @key{i} in threads buffer interrupts thread 1323selecting them. Hitting @kbd{i} in threads buffer interrupts thread
1336under point, @key{c} continues it, @key{s} steps through. More such 1324under point, @kbd{c} continues it, @kbd{s} steps through. More such
1337commands may be added in the future. 1325commands may be added in the future.
1338 1326
1339Combined with creating bound buffers for any thread, this allows you 1327Combined with creating bound buffers for any thread, this allows you