# HG changeset patch # User Jim Blandy # Date 741421650 0 # Node ID ac686479ca5149e6d945650d12f98b41f6e260b0 # Parent d620db2bc4207d1fa9d022ffeb638e199c4276de * gud.el: Add history lists to the debugging commands, so we don't have to retype the filename every invocation. (gud-gdb-history, gud-sdb-history, gud-dbx-history, gud-xdb-history): New variables. (gdb, sdb, dbx, xdb): Use them when reading the argument string. diff -r d620db2bc420 -r ac686479ca51 lisp/gud.el --- a/lisp/gud.el Wed Jun 30 04:56:29 1993 +0000 +++ b/lisp/gud.el Wed Jun 30 06:27:30 1993 +0000 @@ -149,6 +149,9 @@ ;; ====================================================================== ;; gdb functions +;;; History of argument lists passed to gdb. +(defvar gud-gdb-history nil) + (defun gud-gdb-debugger-startup (file args) (apply 'make-comint (concat "gud-" file) "gdb" nil "-fullname" args)) @@ -176,7 +179,13 @@ "Run gdb on program FILE in buffer *gud-FILE*. The directory containing FILE becomes the initial working directory and source-file directory for your debugger." - (interactive "sRun gdb (like this): gdb ") + (interactive + (list (read-from-minibuffer "Run gdb (like this): gdb " + (if (consp gud-gdb-history) + (car gud-gdb-history) + "") + nil nil + '(gud-gdb-history . 1)))) (gud-overload-functions '((gud-debugger-startup . gud-gdb-debugger-startup) (gud-marker-filter . gud-gdb-marker-filter) (gud-find-file . gud-gdb-find-file) @@ -204,6 +213,9 @@ ;; ====================================================================== ;; sdb functions +;;; History of argument lists passed to sdb. +(defvar gud-sdb-history nil) + (defvar gud-sdb-needs-tags (not (file-exists-p "/var")) "If nil, we're on a System V Release 4 and don't need the tags hack.") @@ -247,7 +259,13 @@ "Run sdb on program FILE in buffer *gud-FILE*. The directory containing FILE becomes the initial working directory and source-file directory for your debugger." - (interactive "sRun sdb (like this): sdb ") + (interactive + (list (read-from-minibuffer "Run sdb (like this): sdb " + (if (consp gud-sdb-history) + (car gud-sdb-history) + "") + nil nil + '(gud-sdb-history . 1)))) (if (and gud-sdb-needs-tags (not (and (boundp 'tags-file-name) (file-exists-p tags-file-name)))) (error "The sdb support requires a valid tags table to work.")) @@ -274,6 +292,9 @@ ;; ====================================================================== ;; dbx functions +;;; History of argument lists passed to dbx. +(defvar gud-dbx-history nil) + (defun gud-dbx-debugger-startup (file args) (apply 'make-comint (concat "gud-" file) "dbx" nil args)) @@ -295,7 +316,13 @@ "Run dbx on program FILE in buffer *gud-FILE*. The directory containing FILE becomes the initial working directory and source-file directory for your debugger." - (interactive "sRun dbx (like this): dbx") + (interactive + (list (read-from-minibuffer "Run dbx (like this): dbx " + (if (consp gud-dbx-history) + (car gud-dbx-history) + "") + nil nil + '(gud-dbx-history . 1)))) (gud-overload-functions '((gud-debugger-startup . gud-dbx-debugger-startup) (gud-marker-filter . gud-dbx-marker-filter) (gud-find-file . gud-dbx-find-file) @@ -321,6 +348,9 @@ ;; ====================================================================== ;; xdb (HP PARISC debugger) functions +;;; History of argument lists passed to xdb. +(defvar gud-xdb-history nil) + (defvar gud-xdb-directories nil "*A list of directories that xdb should search for source code. If nil, only source files in the program directory @@ -387,7 +417,13 @@ You can set the variable 'gud-xdb-directories' to a list of program source directories if your program contains sources from more than one directory." - (interactive "sRun xdb (like this): xdb") + (interactive + (list (read-from-minibuffer "Run xdb (like this): xdb " + (if (consp gud-xdb-history) + (car gud-xdb-history) + "") + nil nil + '(gud-xdb-history . 1)))) (gud-overload-functions '((gud-debugger-startup . gud-xdb-debugger-startup) (gud-marker-filter . gud-xdb-marker-filter) (gud-find-file . gud-xdb-find-file)))