diff options
| author | Jim Blandy | 1993-06-30 06:27:30 +0000 |
|---|---|---|
| committer | Jim Blandy | 1993-06-30 06:27:30 +0000 |
| commit | f6376199d51f2ed97ec5a26d393035c38824c12a (patch) | |
| tree | 2e6780e12c341d0c0617d7df5af24e692e7833b8 | |
| parent | 764cb3f9d25bd879a9af4cabf2d08f7db26052da (diff) | |
| download | emacs-f6376199d51f2ed97ec5a26d393035c38824c12a.tar.gz emacs-f6376199d51f2ed97ec5a26d393035c38824c12a.zip | |
* 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.
| -rw-r--r-- | lisp/gud.el | 44 |
1 files changed, 40 insertions, 4 deletions
diff --git a/lisp/gud.el b/lisp/gud.el index 94d983b0c0d..a78b366e7cb 100644 --- a/lisp/gud.el +++ b/lisp/gud.el | |||
| @@ -149,6 +149,9 @@ we're in the GUD buffer)." | |||
| 149 | ;; ====================================================================== | 149 | ;; ====================================================================== |
| 150 | ;; gdb functions | 150 | ;; gdb functions |
| 151 | 151 | ||
| 152 | ;;; History of argument lists passed to gdb. | ||
| 153 | (defvar gud-gdb-history nil) | ||
| 154 | |||
| 152 | (defun gud-gdb-debugger-startup (file args) | 155 | (defun gud-gdb-debugger-startup (file args) |
| 153 | (apply 'make-comint (concat "gud-" file) "gdb" nil "-fullname" args)) | 156 | (apply 'make-comint (concat "gud-" file) "gdb" nil "-fullname" args)) |
| 154 | 157 | ||
| @@ -176,7 +179,13 @@ we're in the GUD buffer)." | |||
| 176 | "Run gdb on program FILE in buffer *gud-FILE*. | 179 | "Run gdb on program FILE in buffer *gud-FILE*. |
| 177 | The directory containing FILE becomes the initial working directory | 180 | The directory containing FILE becomes the initial working directory |
| 178 | and source-file directory for your debugger." | 181 | and source-file directory for your debugger." |
| 179 | (interactive "sRun gdb (like this): gdb ") | 182 | (interactive |
| 183 | (list (read-from-minibuffer "Run gdb (like this): gdb " | ||
| 184 | (if (consp gud-gdb-history) | ||
| 185 | (car gud-gdb-history) | ||
| 186 | "") | ||
| 187 | nil nil | ||
| 188 | '(gud-gdb-history . 1)))) | ||
| 180 | (gud-overload-functions '((gud-debugger-startup . gud-gdb-debugger-startup) | 189 | (gud-overload-functions '((gud-debugger-startup . gud-gdb-debugger-startup) |
| 181 | (gud-marker-filter . gud-gdb-marker-filter) | 190 | (gud-marker-filter . gud-gdb-marker-filter) |
| 182 | (gud-find-file . gud-gdb-find-file) | 191 | (gud-find-file . gud-gdb-find-file) |
| @@ -204,6 +213,9 @@ and source-file directory for your debugger." | |||
| 204 | ;; ====================================================================== | 213 | ;; ====================================================================== |
| 205 | ;; sdb functions | 214 | ;; sdb functions |
| 206 | 215 | ||
| 216 | ;;; History of argument lists passed to sdb. | ||
| 217 | (defvar gud-sdb-history nil) | ||
| 218 | |||
| 207 | (defvar gud-sdb-needs-tags (not (file-exists-p "/var")) | 219 | (defvar gud-sdb-needs-tags (not (file-exists-p "/var")) |
| 208 | "If nil, we're on a System V Release 4 and don't need the tags hack.") | 220 | "If nil, we're on a System V Release 4 and don't need the tags hack.") |
| 209 | 221 | ||
| @@ -247,7 +259,13 @@ and source-file directory for your debugger." | |||
| 247 | "Run sdb on program FILE in buffer *gud-FILE*. | 259 | "Run sdb on program FILE in buffer *gud-FILE*. |
| 248 | The directory containing FILE becomes the initial working directory | 260 | The directory containing FILE becomes the initial working directory |
| 249 | and source-file directory for your debugger." | 261 | and source-file directory for your debugger." |
| 250 | (interactive "sRun sdb (like this): sdb ") | 262 | (interactive |
| 263 | (list (read-from-minibuffer "Run sdb (like this): sdb " | ||
| 264 | (if (consp gud-sdb-history) | ||
| 265 | (car gud-sdb-history) | ||
| 266 | "") | ||
| 267 | nil nil | ||
| 268 | '(gud-sdb-history . 1)))) | ||
| 251 | (if (and gud-sdb-needs-tags | 269 | (if (and gud-sdb-needs-tags |
| 252 | (not (and (boundp 'tags-file-name) (file-exists-p tags-file-name)))) | 270 | (not (and (boundp 'tags-file-name) (file-exists-p tags-file-name)))) |
| 253 | (error "The sdb support requires a valid tags table to work.")) | 271 | (error "The sdb support requires a valid tags table to work.")) |
| @@ -274,6 +292,9 @@ and source-file directory for your debugger." | |||
| 274 | ;; ====================================================================== | 292 | ;; ====================================================================== |
| 275 | ;; dbx functions | 293 | ;; dbx functions |
| 276 | 294 | ||
| 295 | ;;; History of argument lists passed to dbx. | ||
| 296 | (defvar gud-dbx-history nil) | ||
| 297 | |||
| 277 | (defun gud-dbx-debugger-startup (file args) | 298 | (defun gud-dbx-debugger-startup (file args) |
| 278 | (apply 'make-comint (concat "gud-" file) "dbx" nil args)) | 299 | (apply 'make-comint (concat "gud-" file) "dbx" nil args)) |
| 279 | 300 | ||
| @@ -295,7 +316,13 @@ and source-file directory for your debugger." | |||
| 295 | "Run dbx on program FILE in buffer *gud-FILE*. | 316 | "Run dbx on program FILE in buffer *gud-FILE*. |
| 296 | The directory containing FILE becomes the initial working directory | 317 | The directory containing FILE becomes the initial working directory |
| 297 | and source-file directory for your debugger." | 318 | and source-file directory for your debugger." |
| 298 | (interactive "sRun dbx (like this): dbx") | 319 | (interactive |
| 320 | (list (read-from-minibuffer "Run dbx (like this): dbx " | ||
| 321 | (if (consp gud-dbx-history) | ||
| 322 | (car gud-dbx-history) | ||
| 323 | "") | ||
| 324 | nil nil | ||
| 325 | '(gud-dbx-history . 1)))) | ||
| 299 | (gud-overload-functions '((gud-debugger-startup . gud-dbx-debugger-startup) | 326 | (gud-overload-functions '((gud-debugger-startup . gud-dbx-debugger-startup) |
| 300 | (gud-marker-filter . gud-dbx-marker-filter) | 327 | (gud-marker-filter . gud-dbx-marker-filter) |
| 301 | (gud-find-file . gud-dbx-find-file) | 328 | (gud-find-file . gud-dbx-find-file) |
| @@ -321,6 +348,9 @@ and source-file directory for your debugger." | |||
| 321 | ;; ====================================================================== | 348 | ;; ====================================================================== |
| 322 | ;; xdb (HP PARISC debugger) functions | 349 | ;; xdb (HP PARISC debugger) functions |
| 323 | 350 | ||
| 351 | ;;; History of argument lists passed to xdb. | ||
| 352 | (defvar gud-xdb-history nil) | ||
| 353 | |||
| 324 | (defvar gud-xdb-directories nil | 354 | (defvar gud-xdb-directories nil |
| 325 | "*A list of directories that xdb should search for source code. | 355 | "*A list of directories that xdb should search for source code. |
| 326 | If nil, only source files in the program directory | 356 | If nil, only source files in the program directory |
| @@ -387,7 +417,13 @@ and source-file directory for your debugger. | |||
| 387 | 417 | ||
| 388 | You can set the variable 'gud-xdb-directories' to a list of program source | 418 | You can set the variable 'gud-xdb-directories' to a list of program source |
| 389 | directories if your program contains sources from more than one directory." | 419 | directories if your program contains sources from more than one directory." |
| 390 | (interactive "sRun xdb (like this): xdb") | 420 | (interactive |
| 421 | (list (read-from-minibuffer "Run xdb (like this): xdb " | ||
| 422 | (if (consp gud-xdb-history) | ||
| 423 | (car gud-xdb-history) | ||
| 424 | "") | ||
| 425 | nil nil | ||
| 426 | '(gud-xdb-history . 1)))) | ||
| 391 | (gud-overload-functions '((gud-debugger-startup . gud-xdb-debugger-startup) | 427 | (gud-overload-functions '((gud-debugger-startup . gud-xdb-debugger-startup) |
| 392 | (gud-marker-filter . gud-xdb-marker-filter) | 428 | (gud-marker-filter . gud-xdb-marker-filter) |
| 393 | (gud-find-file . gud-xdb-find-file))) | 429 | (gud-find-file . gud-xdb-find-file))) |