aboutsummaryrefslogtreecommitdiffstats
path: root/doc
diff options
context:
space:
mode:
authorNick Roberts2009-12-29 20:15:34 +1300
committerNick Roberts2009-12-29 20:15:34 +1300
commit49f073bd8a61b525da3fbc35981abdaa7fc24182 (patch)
treec4dc7de6c4a412d118c1ed10ad4ac589856bfd5f /doc
parent460f6e7ced30ef7dbbf05284f0ca28f94e613c71 (diff)
downloademacs-49f073bd8a61b525da3fbc35981abdaa7fc24182.tar.gz
emacs-49f073bd8a61b525da3fbc35981abdaa7fc24182.zip
This changeset reverts GDB Graphical Interface to use annotations. It incorporates features added
(and never released) on the EMACS_23_1_RC branch. Namely reverse debugging and the display of STL collections as watch expressions. The long term aim is to move to GDB/MI, so these changes will be re-instated at some time in the future. At the moment, however, there are issues with gdb-mi.el that have not yet
Diffstat (limited to 'doc')
-rw-r--r--doc/emacs/building.texi225
-rw-r--r--doc/emacs/emacs.texi18
2 files changed, 51 insertions, 192 deletions
diff --git a/doc/emacs/building.texi b/doc/emacs/building.texi
index a5ce5f20c7b..343eb646a83 100644
--- a/doc/emacs/building.texi
+++ b/doc/emacs/building.texi
@@ -854,12 +854,11 @@ 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.
858* Stack Buffer:: Select a frame from the call stack. 857* Stack Buffer:: Select a frame from the call stack.
859* Other GDB-UI Buffers:: Input/output, locals, registers, 858* Other GDB-UI Buffers:: Input/output, locals, registers,
860 assembler, threads and memory buffers. 859 assembler, threads and memory buffers.
861* Watch Expressions:: Monitor variable values in the speedbar. 860* Watch Expressions:: Monitor variable values in the speedbar.
862* Multithreaded Debugging:: Debugging programs with several threads. 861* Reverse Debugging:: Execute and reverse debug your program.
863@end menu 862@end menu
864 863
865@node GDB-UI Layout 864@node GDB-UI Layout
@@ -884,7 +883,7 @@ displays the following frame layout:
884|--------------------------------+--------------------------------+ 883|--------------------------------+--------------------------------+
885| Primary Source buffer | I/O buffer for debugged pgm | 884| Primary Source buffer | I/O buffer for debugged pgm |
886|--------------------------------+--------------------------------+ 885|--------------------------------+--------------------------------+
887| Stack buffer | Breakpoints/Thread buffer | 886| Stack buffer | Breakpoints/Threads buffer |
888+--------------------------------+--------------------------------+ 887+--------------------------------+--------------------------------+
889@end group 888@end group
890@end smallexample 889@end smallexample
@@ -1012,92 +1011,10 @@ Visit the source line for the current breakpoint
1012Visit the source line for the breakpoint you click on. 1011Visit the source line for the breakpoint you click on.
1013@end table 1012@end table
1014 1013
1015@vindex gdb-show-threads-by-default
1016When @code{gdb-many-windows} is non-@code{nil}, the breakpoints buffer 1014When @code{gdb-many-windows} is non-@code{nil}, the breakpoints buffer
1017shares its window with the threads buffer. To switch from one to the 1015shares 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 1016other click with @kbd{Mouse-1} on the relevant button in the header
1019line, or press @kbd{TAB} inside that buffer. If 1017line.
1020@code{gdb-show-threads-by-default} is non-@code{nil}, the threads
1021buffer, rather than the breakpoints buffer, is shown at start up.
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 It’s possible to observe information for several threads
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}).
1101 1018
1102@node Stack Buffer 1019@node Stack Buffer
1103@subsubsection Stack Buffer 1020@subsubsection Stack Buffer
@@ -1134,7 +1051,7 @@ as are the commands to send signals to the debugged program.
1134@item Locals Buffer 1051@item Locals Buffer
1135The locals buffer displays the values of local variables of the 1052The locals buffer displays the values of local variables of the
1136current frame for simple data types (@pxref{Frame Info, Frame Info, 1053current frame for simple data types (@pxref{Frame Info, Frame Info,
1137Information on a frame, gdb, The GNU debugger}). Press @key{RET} or 1054Information on a frame, gdb, The GNU debugger}). Press @key{RET} or
1138click @kbd{Mouse-2} on the value if you want to edit it. 1055click @kbd{Mouse-2} on the value if you want to edit it.
1139 1056
1140Arrays and structures display their type only. With GDB 6.4 or later, 1057Arrays and structures display their type only. With GDB 6.4 or later,
@@ -1153,12 +1070,27 @@ With GDB 6.4 or later, recently changed register values display with
1153press @key{SPC} to toggle the display of floating point registers 1070press @key{SPC} to toggle the display of floating point registers
1154(@code{toggle-gdb-all-registers}). 1071(@code{toggle-gdb-all-registers}).
1155 1072
1156@item Disassembly Buffer 1073@item Assembler Buffer
1157The disassembly buffer displays the current frame as machine code. An 1074The assembler buffer displays the current frame as machine code. An
1158arrow points to the current instruction, and you can set and remove 1075arrow points to the current instruction, and you can set and remove
1159breakpoints as in a source buffer. Breakpoint icons also appear in 1076breakpoints as in a source buffer. Breakpoint icons also appear in
1160the fringe or margin. 1077the fringe or margin.
1161 1078
1079@item Threads Buffer
1080@findex gdb-threads-select
1081The threads buffer displays a summary of all threads currently in your
1082program (@pxref{Threads, Threads, Debugging programs with multiple
1083threads, gdb, The GNU debugger}). Move point to any thread in the
1084list and press @key{RET} to select it (@code{gdb-threads-select}) and
1085display the associated source in the primary source buffer.
1086Alternatively, click @kbd{Mouse-2} on a thread to select it. If the
1087locals buffer is visible, its contents update to display the variables
1088that are local in the new thread.
1089
1090When there is more than one main thread and the threads buffer is
1091present, Emacs displays the selected thread number in the mode line of
1092many of the GDB-UI Buffers.
1093
1162@item Memory Buffer 1094@item Memory Buffer
1163The memory buffer lets you examine sections of program memory 1095The memory buffer lets you examine sections of program memory
1164(@pxref{Memory, Memory, Examining memory, gdb, The GNU debugger}). 1096(@pxref{Memory, Memory, Examining memory, gdb, The GNU debugger}).
@@ -1171,9 +1103,8 @@ size for these data items.
1171 1103
1172When @code{gdb-many-windows} is non-@code{nil}, the threads buffer 1104When @code{gdb-many-windows} is non-@code{nil}, the threads buffer
1173shares its window with the breakpoints buffer, and the locals buffer 1105shares its window with the breakpoints buffer, and the locals buffer
1174with the registers buffer. To switch from one to the other click with 1106with the registers buffer. To switch from one to the other click with
1175@kbd{Mouse-1} on the relevant button in the header line or press 1107@kbd{Mouse-1} on the relevant button in the header line.
1176@kbd{TAB} inside the buffer.
1177 1108
1178@node Watch Expressions 1109@node Watch Expressions
1179@subsubsection Watch Expressions 1110@subsubsection Watch Expressions
@@ -1241,96 +1172,26 @@ expressions updates, set @code{gdb-speedbar-auto-raise} to
1241non-@code{nil}. This can be useful if you are debugging with a full 1172non-@code{nil}. This can be useful if you are debugging with a full
1242screen Emacs frame. 1173screen Emacs frame.
1243 1174
1244@node Multithreaded Debugging 1175@node Reverse Debugging
1245@subsubsection Stopping and Starting Multi-threaded Programs 1176@subsubsection Reverse Debugging
1246@cindex Multithreaded debugging in GDB 1177
1247 1178 The GDB tool bar shares many buttons with the other GUD debuggers
1248@subsubheading All-stop Debugging 1179for tasks like stepping and printing expressions. It also has a
1249 1180further set of buttons that allow reverse debugging (@pxref{Process
1250In all-stop mode, whenever your program stops, @emph{all} threads of 1181Record and Replay, , ,gdb, The GNU debugger}). This is useful when it
1251execution stop. Likewise, whenever you restart the program, all 1182takes a long time to reproduce the conditions where your program fails
1252threads start executing. @xref{All-Stop Mode, , All-Stop Mode, gdb, 1183or for transient problems, like race conditions in multi-threaded
1253The GNU debugger}. You can enable this behaviour in Emacs by setting 1184programs, where a failure might otherwise be hard to reproduce.
1254@code{gdb-non-stop-setting} to @code{nil} before starting a debugging 1185
1255session. 1186To use reverse debugging, set a breakpoint slightly before the
1256 1187location of interest and run your program to that point. Enable
1257@subsubheading Non-stop Debugging 1188process recording by clicking on the record button. At this point, a
1258@cindex Non-stop debugging in GDB 1189new set of buttons appear. These buttons allow program execution in
1259 1190the reverse direction. Run your program over the code where the
1260For some multi-threaded targets, GDB supports a further mode of 1191problem occurs, and then use the new set of buttons to retrace your
1261operation in which you can examine stopped program threads in the 1192steps, examine values, and analyze the problem. When analysis is
1262debugger while other threads continue to execute freely. 1193complete, turn off process recording by clicking on the record button
1263@xref{Non-Stop Mode, , Non-Stop Mode, gdb, The GNU debugger}. 1194again.
1264This is referred to as @dfn{non-stop} mode.
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}.
1269
1270@vindex gdb-non-stop-setting
1271If the variable @code{gdb-non-stop-setting} is non-@code{nil} (the
1272default value), Emacs tries to start GDB in non-stop mode. Note that
1273GDB debugging session needs to be restarted for change of this setting
1274to take effect.
1275
1276@vindex gdb-switch-when-another-stopped
1277When a thread stops in non-stop mode, Emacs automatically switches to
1278that thread. It may be undesirable to allow switching of current
1279thread when some other stopped thread is already selected. Set
1280@code{gdb-switch-when-another-stopped} to @code{nil} to prevent this.
1281
1282@vindex gdb-switch-reasons
1283Emacs can decide whether or not to switch to the stopped thread
1284depending on the reason which caused the stop. Customize
1285@code{gdb-switch-reasons} to select stop reasons which make Emacs
1286switch thread.
1287
1288@vindex gdb-stopped-hooks
1289The variable @code{gdb-stopped-hooks} allows you to execute your
1290functions whenever some thread stops.
1291
1292 In non-stop mode, you can switch between different modes for GUD
1293execution control commands.
1294
1295@vindex gdb-gud-control-all-threads
1296@table @dfn
1297@item Non-stop/A
1298
1299When @code{gdb-gud-control-all-threads} is @code{t} (the default
1300value), interruption and continuation commands apply to all threads,
1301so you can halt or continue all your threads with one command using
1302@code{gud-stop-subjob} and @code{gud-cont}, respectively. The
1303@samp{Go} button is shown on the toolbar when at least one thread is
1304stopped, whereas @samp{Stop} button is shown when at least one thread
1305is running.
1306
1307@item Non-stop/T
1308
1309When @code{gdb-gud-control-all-threads} is @code{nil}, only the
1310current thread is stopped/continued. @samp{Go} and @samp{Stop}
1311buttons on the GUD toolbar are shown depending on the state of current
1312thread.
1313@end table
1314
1315You can change the current value of @code{gdb-gud-control-all-threads}
1316from the tool bar or from @samp{GUD->GDB-MI} menu.
1317
1318 Stepping commands always apply to the current thread.
1319
1320@subsubheading Fine Thread Control
1321
1322 In non-stop mode, you can interrupt/continue your threads without
1323selecting them. Hitting @kbd{i} in threads buffer interrupts thread
1324under point, @kbd{c} continues it, @kbd{s} steps through. More such
1325commands may be added in the future.
1326
1327Combined with creating bound buffers for any thread, this allows you
1328to change and track state of many threads in the same time.
1329
1330 Note that when you interrupt a thread, it stops with @samp{signal
1331received} reason. If that reason is included in your
1332@code{gdb-switch-reasons} (it is by default), Emacs will switch to
1333that thread.
1334 1195
1335@node Executing Lisp 1196@node Executing Lisp
1336@section Executing Lisp Expressions 1197@section Executing Lisp Expressions
diff --git a/doc/emacs/emacs.texi b/doc/emacs/emacs.texi
index 4b9ea28dcc3..7037574245a 100644
--- a/doc/emacs/emacs.texi
+++ b/doc/emacs/emacs.texi
@@ -745,16 +745,14 @@ Running Debuggers Under Emacs
745 745
746GDB Graphical Interface 746GDB Graphical Interface
747 747
748* GDB-UI Layout:: Control the number of displayed buffers. 748* GDB-UI Layout:: Control the number of displayed buffers.
749* Source Buffers:: Use the mouse in the fringe/margin to 749* Source Buffers:: Use the mouse in the fringe/margin to
750 control your program. 750 control your program.
751* Breakpoints Buffer:: A breakpoint control panel. 751* Breakpoints Buffer:: A breakpoint control panel.
752* Threads Buffer:: Displays your threads. 752* Stack Buffer:: Select a frame from the call stack.
753* Stack Buffer:: Select a frame from the call stack. 753* Other GDB-UI Buffers::Input/output, locals, registers,
754* Other GDB-UI Buffers:: Input/output, locals, registers, 754 assembler, threads and memory buffers.
755 assembler, threads and memory buffers. 755* Watch Expressions:: Monitor variable values in the speedbar.
756* Watch Expressions:: Monitor variable values in the speedbar.
757* Multithreaded Debugging:: Debugging programs with several threads.
758 756
759Maintaining Large Programs 757Maintaining Large Programs
760 758