aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNick Roberts2007-10-04 07:44:28 +0000
committerNick Roberts2007-10-04 07:44:28 +0000
commit4d4cc7800d2e2ec4bd6d05bc25a9baf1fe849b8f (patch)
tree6f4f2bd63f42e66a9c64d52c1df9b4cbfea03c9b
parent7285a019fe29cb08ddbfa23127c76b100833f93a (diff)
downloademacs-4d4cc7800d2e2ec4bd6d05bc25a9baf1fe849b8f.tar.gz
emacs-4d4cc7800d2e2ec4bd6d05bc25a9baf1fe849b8f.zip
(gud-gdb-command-name, gdb): Move here from gud.el and adapt doc string.
(gud-gdba-command-name, gdba): Delete.
-rw-r--r--lisp/progmodes/gdb-ui.el82
1 files changed, 61 insertions, 21 deletions
diff --git a/lisp/progmodes/gdb-ui.el b/lisp/progmodes/gdb-ui.el
index a0bd32f355c..89211732e44 100644
--- a/lisp/progmodes/gdb-ui.el
+++ b/lisp/progmodes/gdb-ui.el
@@ -34,8 +34,7 @@
34;; Emacs 21 such as the fringe/display margin for breakpoints, and the toolbar 34;; Emacs 21 such as the fringe/display margin for breakpoints, and the toolbar
35;; (see the GDB Graphical Interface section in the Emacs info manual). 35;; (see the GDB Graphical Interface section in the Emacs info manual).
36 36
37;; By default, M-x gdb will start the debugger. However, if you have customised 37;; By default, M-x gdb will start the debugger.
38;; gud-gdb-command-name, then start it with M-x gdba.
39 38
40;; This file has evolved from gdba.el that was included with GDB 5.0 and 39;; This file has evolved from gdba.el that was included with GDB 5.0 and
41;; written by Tom Lord and Jim Kingdon. It uses GDB's annotation interface. 40;; written by Tom Lord and Jim Kingdon. It uses GDB's annotation interface.
@@ -218,13 +217,11 @@ handlers.")
218 "List of changed register numbers (strings).") 217 "List of changed register numbers (strings).")
219 218
220;;;###autoload 219;;;###autoload
221(defun gdba (command-line) 220(defun gdb (command-line)
222 "Run gdb on program FILE in buffer *gud-FILE*. 221 "Run gdb on program FILE in buffer *gud-FILE*.
223The directory containing FILE becomes the initial working directory 222The directory containing FILE becomes the initial working
224and source-file directory for your debugger. 223directory and source-file directory for your debugger.
225 224
226This function requires that GDB is run with \"--annotate=3\", so
227don't edit this option in the mini-buffer.
228 225
229If `gdb-many-windows' is nil (the default value) then gdb just 226If `gdb-many-windows' is nil (the default value) then gdb just
230pops up the GUD buffer unless `gdb-show-main' is t. In this case 227pops up the GUD buffer unless `gdb-show-main' is t. In this case
@@ -269,17 +266,61 @@ detailed description of this mode.
269| RET gdb-frames-select | SPC gdb-toggle-breakpoint | 266| RET gdb-frames-select | SPC gdb-toggle-breakpoint |
270| | RET gdb-goto-breakpoint | 267| | RET gdb-goto-breakpoint |
271| | D gdb-delete-breakpoint | 268| | D gdb-delete-breakpoint |
272+-----------------------------------+----------------------------------+" 269+-----------------------------------+----------------------------------+
273 ;; 270
274 (interactive (list (gud-query-cmdline 'gdba))) 271To run GDB in text command mode, replace the GDB \"--annotate=3\"
275 ;; 272option with \"--fullname\" either in the minibuffer for the
276 ;; Do this early in case user enters commands before GDB is ready. 273current Emacs session, or the custom variable
277 (setq comint-input-sender 'gdb-send) 274`gud-gdb-command-name' for all future sessions. You need to use
278 (setq gdb-ready nil) 275text command mode to debug multiple programs within one Emacs
276session."
277 (interactive (list (gud-query-cmdline 'gdb)))
278
279 (when (and gud-comint-buffer
280 (buffer-name gud-comint-buffer)
281 (get-buffer-process gud-comint-buffer)
282 (with-current-buffer gud-comint-buffer (eq gud-minor-mode 'gdba)))
283 (gdb-restore-windows)
284 (error
285 "Multiple debugging requires restarting in text command mode"))
286
287 (gud-common-init command-line nil 'gud-gdba-marker-filter)
288 (set (make-local-variable 'gud-minor-mode) 'gdba)
289
290 (gud-def gud-break "break %f:%l" "\C-b" "Set breakpoint at current line.")
291 (gud-def gud-tbreak "tbreak %f:%l" "\C-t"
292 "Set temporary breakpoint at current line.")
293 (gud-def gud-remove "clear %f:%l" "\C-d" "Remove breakpoint at current line")
294 (gud-def gud-step "step %p" "\C-s" "Step one source line with display.")
295 (gud-def gud-stepi "stepi %p" "\C-i" "Step one instruction with display.")
296 (gud-def gud-next "next %p" "\C-n" "Step one line (skip functions).")
297 (gud-def gud-nexti "nexti %p" nil "Step one instruction (skip functions).")
298 (gud-def gud-cont "cont" "\C-r" "Continue with display.")
299 (gud-def gud-finish "finish" "\C-f" "Finish executing current function.")
300 (gud-def gud-jump
301 (progn (gud-call "tbreak %f:%l") (gud-call "jump %f:%l"))
302 "\C-j" "Set execution address to current line.")
303
304 (gud-def gud-up "up %p" "<" "Up N stack frames (numeric arg).")
305 (gud-def gud-down "down %p" ">" "Down N stack frames (numeric arg).")
306 (gud-def gud-print "print %e" "\C-p" "Evaluate C expression at point.")
307 (gud-def gud-pstar "print* %e" nil
308 "Evaluate C dereferenced pointer expression at point.")
279 309
280 ;; Let's start with a basic gud-gdb buffer and then modify it a bit. 310 ;; For debugging Emacs only.
281 (gdb command-line) 311 (gud-def gud-pv "pv1 %e" "\C-v" "Print the value of the lisp variable.")
282 (gdb-init-1)) 312
313 (gud-def gud-until "until %l" "\C-u" "Continue to current line.")
314 (gud-def gud-run "run" nil "Run the program.")
315
316 (local-set-key "\C-i" 'gud-gdb-complete-command)
317 (setq comint-prompt-regexp "^(.*gdb[+]?) *")
318 (setq paragraph-start comint-prompt-regexp)
319 (setq gdb-first-prompt t)
320 (setq gud-running nil)
321 (setq gdb-ready nil)
322 (setq gud-filter-pending-text nil)
323 (run-hooks 'gdb-mode-hook))
283 324
284(defcustom gdb-debug-log-max 128 325(defcustom gdb-debug-log-max 128
285 "Maximum size of `gdb-debug-log'. If nil, size is unlimited." 326 "Maximum size of `gdb-debug-log'. If nil, size is unlimited."
@@ -603,7 +644,7 @@ otherwise do not."
603 (gdb-enqueue-input (list "server list\n" 'ignore)) 644 (gdb-enqueue-input (list "server list\n" 'ignore))
604 (gdb-enqueue-input (list "server info source\n" 'gdb-source-info)) 645 (gdb-enqueue-input (list "server info source\n" 'gdb-source-info))
605 646
606 (run-hooks 'gdba-mode-hook)) 647 (run-hooks 'gdb-mode-hook))
607 648
608(defun gdb-get-version () 649(defun gdb-get-version ()
609 (goto-char (point-min)) 650 (goto-char (point-min))
@@ -1198,9 +1239,8 @@ This filter may simply queue input for a later time."
1198;; any newlines. 1239;; any newlines.
1199;; 1240;;
1200 1241
1201(defcustom gud-gdba-command-name "gdb --annotate=3" 1242(defcustom gud-gdb-command-name "gdb --annotate=3"
1202 "Default command to execute an executable under the GDB-UI debugger. 1243 "Default command to execute an executable under the GDB debugger."
1203The option \"--annotate=3\" must be included in it's value."
1204 :type 'string 1244 :type 'string
1205 :group 'gud 1245 :group 'gud
1206 :version "22.1") 1246 :version "22.1")