comparison lisp/progmodes/gdb-ui.el @ 86227:5931e03fc5d5

Update commentary.
author Nick Roberts <nickrob@snap.net.nz>
date Mon, 19 Nov 2007 07:34:18 +0000
parents d04fdae07d21
children f43509daf0ee
comparison
equal deleted inserted replaced
86226:e9161073ed7b 86227:5931e03fc5d5
41 ;; You don't need to know about annotations to use this mode as a debugger, 41 ;; You don't need to know about annotations to use this mode as a debugger,
42 ;; but if you are interested developing the mode itself, see the Annotations 42 ;; but if you are interested developing the mode itself, see the Annotations
43 ;; section in the GDB info manual. 43 ;; section in the GDB info manual.
44 44
45 ;; GDB developers plan to make the annotation interface obsolete. A new 45 ;; GDB developers plan to make the annotation interface obsolete. A new
46 ;; interface called GDB/MI (machine interface) has been designed to replace 46 ;; interface called GDB/MI (machine interface) has been designed to replace it.
47 ;; it. Some GDB/MI commands are used in this file through the CLI command 47 ;; Some GDB/MI commands are used in this file through the CLI command
48 ;; 'interpreter mi <mi-command>'. A file called gdb-mi.el is included with 48 ;; 'interpreter mi <mi-command>'. To help with the process of fully migrating
49 ;; GDB (6.2 onwards) that uses GDB/MI as the primary interface to GDB. It is 49 ;; Emacs from annotations to GDB/MI, there is an experimental package called
50 ;; still under development and is part of a process to migrate Emacs from 50 ;; gdb-mi in the Emacs Lisp Package Archive ("http://tromey.com/elpa/"). It
51 ;; annotations to GDB/MI. 51 ;; comprises of modified gud.el and a file called gdb-mi.el which replaces
52 ;; gdb-ui.el. When installed, this overrides the current files and invoking
53 ;; M-x gdb will use GDB/MI directly (starts with "gdb -i=mi"). When deleted
54 ;; ('d' followed by 'x' in Package Menu mode), the files are deleted and old
55 ;; functionality restored. This provides a convenient way to review the
56 ;; current status/contribute to its improvement. For someone who just wants to
57 ;; use GDB, however, the current mode in Emacs 22 is a much better option.
58 ;; There is also a file, also called gdb-mi.el, a version of which is included
59 ;; the GDB distribution. This will probably only work with versions
60 ;; distributed with GDB 6.5 or later. Unlike the version in ELPA it works on
61 ;; top of gdb-ui.el and you can only start it with M-x gdbmi.
52 62
53 ;; This mode SHOULD WORK WITH GDB 5.0 or later but you will NEED AT LEAST 63 ;; This mode SHOULD WORK WITH GDB 5.0 or later but you will NEED AT LEAST
54 ;; GDB 6.0 to use watch expressions. It works best with GDB 6.4 or later 64 ;; GDB 6.0 to use watch expressions. It works best with GDB 6.4 or later
55 ;; where watch expressions will update more quickly. 65 ;; where watch expressions will update more quickly.
56 66
67 77
68 ;; and compiling with -DUNBUFFERED while debugging. 78 ;; and compiling with -DUNBUFFERED while debugging.
69 79
70 ;;; Known Bugs: 80 ;;; Known Bugs:
71 81
72 ;; 1) Strings that are watched don't update in the speedbar when their 82 ;; 1) Cannot handle multiple debug sessions.
73 ;; contents change unless the first character changes. 83 ;; 2) If you wish to call procedures from your program in GDB
74 ;; 2) Cannot handle multiple debug sessions.
75 ;; 3) M-x gdb doesn't work with "run" command in .gdbinit, use M-x gdba instead.
76 ;; 4) M-x gdb doesn't work if the corefile is specified in the command in the
77 ;; minibuffer, use M-x gdba instead (or specify the core in the GUD buffer).
78 ;; 5) If you wish to call procedures from your program in GDB
79 ;; e.g "call myproc ()", "p mysquare (5)" then use level 2 annotations 84 ;; e.g "call myproc ()", "p mysquare (5)" then use level 2 annotations
80 ;; "gdb --annotate=2 myprog" to keep source buffer/selected frame fixed. 85 ;; "gdb --annotate=2 myprog" to keep source buffer/selected frame fixed.
81 ;; 6) After detaching from a process, clicking on the "GO" icon on toolbar 86 ;; 3) After detaching from a process, clicking on the "GO" icon on toolbar
82 ;; (gud-go) sends "continue" to GDB (should be "run"). 87 ;; (gud-go) sends "continue" to GDB (should be "run").
83
84 ;;; Problems with watch expressions, GDB/MI:
85
86 ;; 1) They go out of scope when the inferior is re-run.
87 ;; 2) -stack-list-locals has a type field but also prints type in values field.
88 ;; 3) VARNUM increments even when variable object is not created
89 ;; (maybe trivial).
90 88
91 ;;; TODO: 89 ;;; TODO:
92 90
93 ;; 1) Use MI command -data-read-memory for memory window. 91 ;; 1) Use MI command -data-read-memory for memory window.
94 ;; 2) Use tree-widget.el instead of the speedbar for watch-expressions? 92 ;; 2) Use tree-widget.el instead of the speedbar for watch-expressions?
220 ;;;###autoload 218 ;;;###autoload
221 (defun gdb (command-line) 219 (defun gdb (command-line)
222 "Run gdb on program FILE in buffer *gud-FILE*. 220 "Run gdb on program FILE in buffer *gud-FILE*.
223 The directory containing FILE becomes the initial working 221 The directory containing FILE becomes the initial working
224 directory and source-file directory for your debugger. 222 directory and source-file directory for your debugger.
225
226 223
227 If `gdb-many-windows' is nil (the default value) then gdb just 224 If `gdb-many-windows' is nil (the default value) then gdb just
228 pops up the GUD buffer unless `gdb-show-main' is t. In this case 225 pops up the GUD buffer unless `gdb-show-main' is t. In this case
229 it starts with two windows: one displaying the GUD buffer and the 226 it starts with two windows: one displaying the GUD buffer and the
230 other with the source file with the main routine of the inferior. 227 other with the source file with the main routine of the inferior.