aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDmitry Dzhus2009-08-08 17:00:52 +0000
committerDmitry Dzhus2009-08-08 17:00:52 +0000
commit8d6bb99e733acf952a9e43a47e3e7ef48ca1f31c (patch)
tree9957c265bd2c5b6bd8057648f3702166cf085ed7
parent7c4654ad3b6d5c286138a270057716b01e4edd18 (diff)
downloademacs-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/ChangeLog7
-rw-r--r--doc/emacs/building.texi219
-rw-r--r--doc/emacs/emacs.texi18
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 @@
12009-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
12009-08-08 Glenn Morris <rgm@gnu.org> 82009-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,
905either in the same frame or a different one. Select the buffers you 907either in the same frame or a different one. Select the buffers you
906want with the @samp{GUD->GDB-windows} and @samp{GUD->GDB-Frames} 908want with the @samp{GUD->GDB-Windows} and @samp{GUD->GDB-Frames}
907sub-menus. If the menu-bar is unavailable, type @code{M-x 909sub-menus. If the menu-bar is unavailable, type @code{M-x
908gdb-display-@var{buffertype}-buffer} or @code{M-x 910gdb-display-@var{buffertype}-buffer} or @code{M-x
909gdb-frame-@var{buffertype}-buffer} respectively, where 911gdb-frame-@var{buffertype}-buffer} respectively, where
@@ -1010,10 +1012,50 @@ Visit the source line for the current breakpoint
1010Visit the source line for the breakpoint you click on. 1012Visit the source line for the breakpoint you click on.
1011@end table 1013@end table
1012 1014
1015@vindex gdb-show-threads-by-default
1013When @code{gdb-many-windows} is non-@code{nil}, the breakpoints buffer 1016When @code{gdb-many-windows} is non-@code{nil}, the breakpoints buffer
1014shares 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
1015other 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
1016line. 1019line, or press @kbd{TAB} inside that buffer. When
1020@code{gdb-show-threads-by-default} is non-@code{nil}, threads buffer
1021is shown in place of breakpoints buffer by default.
1022
1023@node Threads Buffer
1024@subsubsection Threads Buffer
1025
1026@findex gdb-select-thread
1027The threads buffer displays a summary of all threads currently in your
1028program (@pxref{Threads, Threads, Debugging programs with multiple
1029threads, gdb, The GNU debugger}). Move point to any thread in the list
1030and press @key{RET} to select it (@code{gdb-select-thread}) and
1031display the associated source in the primary source buffer.
1032Alternatively, click @kbd{Mouse-2} on a thread to select it. Contents
1033of all GDB buffers are updated whenever you select a thread.
1034
1035 You can customize variables under @code{gdb-buffers} group to select
1036fields included in threads buffer.
1037
1038@table @code
1039@item gdb-thread-buffer-verbose-names
1040@vindex gdb-thread-buffer-verbose-names
1041Show long thread names like @samp{Thread 0x4e2ab70 (LWP 1983)} in
1042threads buffer.
1043
1044@item gdb-thread-buffer-arguments
1045@vindex gdb-thread-buffer-arguments
1046Show arguments of thread top frames in threads buffer.
1047
1048@item gdb-thread-buffer-locations
1049@vindex gdb-thread-buffer-locations
1050Show file information or library names in threads buffer.
1051
1052@item gdb-thread-buffer-addresses
1053@vindex gdb-thread-buffer-addresses
1054Show 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
1069press @key{SPC} to toggle the display of floating point registers 1111press @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
1073The assembler buffer displays the current frame as machine code. An 1115The disassembly buffer displays the current frame as machine code. An
1074arrow points to the current instruction, and you can set and remove 1116arrow points to the current instruction, and you can set and remove
1075breakpoints as in a source buffer. Breakpoint icons also appear in 1117breakpoints as in a source buffer. Breakpoint icons also appear in
1076the fringe or margin. 1118the fringe or margin.
1077 1119
1078@item Threads Buffer
1079@findex gdb-threads-select
1080The threads buffer displays a summary of all threads currently in your
1081program (@pxref{Threads, Threads, Debugging programs with multiple
1082threads, gdb, The GNU debugger}). Move point to any thread in the
1083list and press @key{RET} to select it (@code{gdb-threads-select}) and
1084display the associated source in the primary source buffer.
1085Alternatively, click @kbd{Mouse-2} on a thread to select it. If the
1086locals buffer is visible, its contents update to display the variables
1087that are local in the new thread.
1088
1089When there is more than one main thread and the threads buffer is
1090present, Emacs displays the selected thread number in the mode line of
1091many of the GDB-UI Buffers.
1092
1093@item Memory Buffer 1120@item Memory Buffer
1094The memory buffer lets you examine sections of program memory 1121The 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
1103When @code{gdb-many-windows} is non-@code{nil}, the threads buffer 1130When @code{gdb-many-windows} is non-@code{nil}, the threads buffer
1104shares its window with the breakpoints buffer, and the locals buffer 1131shares its window with the breakpoints buffer, and the locals buffer
1105with the registers buffer. To switch from one to the other click with 1132with 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
1171non-@code{nil}. This can be useful if you are debugging with a full 1199non-@code{nil}. This can be useful if you are debugging with a full
1172screen Emacs frame. 1200screen 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
1213stops, the rest continue to execute, as opposed to traditional
1214@dfn{all-stop mode}, in which stopping of one thread causes @emph{all}
1215threads to stop. @xref{Non-Stop Mode, , Non-Stop Mode, gdb, The GNU
1216debugger}.
1217
1218@vindex gdb-non-stop-setting
1219To activate non-stop debugging in Emacs, set
1220@code{gdb-non-stop-setting} variable to non-@code{nil}. Note that GDB
1221debugging session needs to be restarted for change of this setting to
1222take effect.
1223
1224@vindex gdb-switch-when-another-stopped
1225When a thread stops in non-stop mode, Emacs automatically switches to
1226that thread. It may be undesirable to allow switching of current
1227thread 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
1231Emacs can decide whether or not to switch to stopped thread depending
1232on the reason which caused the stop. Customize
1233@code{gdb-switch-reasons} to select stop reasons which make Emacs
1234switch thread.
1235
1236@vindex gdb-stopped-hooks
1237@code{gdb-stopped-hooks} hook variable allows you to execute your
1238functions whenever some thread stops.
1239
1240 In non-stop mode, you can switch between different modes for GUD
1241execution control commands.
1242
1243@vindex gdb-gud-control-all-threads
1244@table @dfn
1245@item Non-stop/A
1246
1247When @code{gdb-gud-control-all-threads} is @code{t} (that’s default),
1248interruption & continuation commands apply to all threads, so you can
1249halt or continue all your threads with one command
1250(@code{gud-stop-subjob} and @code{gud-cont}, respectively). @samp{Go}
1251button is shown on the toolbar when at least one thread is stopped,
1252whereas @samp{Stop} button is shown when at least one thread is
1253running.
1254
1255@item Non-stop/T
1256
1257When @code{gdb-gud-control-all-threads} is @code{nil}, only current
1258thread is stopped/continued. @samp{Go} and @samp{Stop} buttons on
1259the GUD toolbar are shown depending on the state of current thread.
1260@end table
1261
1262You can change the current value of @code{gdb-gud-control-all-threads}
1263from @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
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
1332@subsubheading Fine Thread Control
1333
1334 In non-stop mode, you can interrupt/continue your threads without
1335selecting them. Hitting @key{i} in threads buffer interrupts thread
1336under point, @key{c} continues it, @key{s} steps through. More such
1337commands may be added in the future.
1338
1339Combined with creating bound buffers for any thread, this allows you
1340to 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
1343received} reason. If that reason is included in your
1344@code{gdb-switch-reasons} (it is by default), Emacs will switch to
1345that 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
745GDB Graphical Interface 745GDB 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
756Maintaining Large Programs 758Maintaining Large Programs
757 759