# HG changeset patch # User Richard M. Stallman # Date 794133181 0 # Node ID 715419786d7f4d79c41d8de4a18fbb696cca37cc # Parent dd15c3dee99b5823690cba32659c4f744636b10b (gud-common-init): Put substed file name back in original sequence in the args. Pass ARGS to massage-file even if no file name. (gud-gdb-massage-args, gud-sdb-massage-args, gud-dbx-massage-args) (gud-mipsdbx-massage-args, gud-xdb-massage-args) (gud-perldb-massage-args): Don't add FILE onto the args. diff -r dd15c3dee99b -r 715419786d7f lisp/gud.el --- a/lisp/gud.el Wed Mar 01 16:03:33 1995 +0000 +++ b/lisp/gud.el Thu Mar 02 08:33:01 1995 +0000 @@ -173,7 +173,7 @@ (defvar gud-gdb-history nil) (defun gud-gdb-massage-args (file args) - (cons "-fullname" (cons file args))) + (cons "-fullname" args)) ;; There's no guarantee that Emacs will hand the filter the entire ;; marker at once; it could be broken up across several strings. We @@ -395,8 +395,7 @@ (defvar gud-sdb-lastfile nil) -(defun gud-sdb-massage-args (file args) - (cons file args)) +(defun gud-sdb-massage-args (file args) args) (defun gud-sdb-marker-filter (string) (setq gud-marker-acc @@ -507,8 +506,7 @@ ;;; History of argument lists passed to dbx. (defvar gud-dbx-history nil) -(defun gud-dbx-massage-args (file args) - (cons file args)) +(defun gud-dbx-massage-args (file args) args) (defun gud-dbx-marker-filter (string) (setq gud-marker-acc (if gud-marker-acc (concat gud-marker-acc string) string)) @@ -553,7 +551,7 @@ "Non-nil to assume the MIPS/OSF dbx conventions (argument `-emacs').") (defun gud-mipsdbx-massage-args (file args) - (cons "-emacs" (cons file args))) + (cons "-emacs" args)) ;; This is just like the gdb one except for the regexps since we need to cope ;; with an optional breakpoint number in [] before the ^Z^Z @@ -781,7 +779,7 @@ (while directories (setq result (cons (car directories) (cons "-d" result))) (setq directories (cdr directories))) - (nreverse (cons file result))) + (nreverse result)) args)) (defun gud-xdb-file-name (f) @@ -883,7 +881,7 @@ (defvar gud-perldb-history nil) (defun gud-perldb-massage-args (file args) - (cons "-d" (cons file (cons "-emacs" args)))) + (cons "-d" (cons "-emacs" args))) ;; There's no guarantee that Emacs will hand the filter the entire ;; marker at once; it could be broken up across several strings. We @@ -1119,13 +1117,17 @@ (defun gud-common-init (command-line massage-args marker-filter find-file) (let* ((words (gud-chop-words command-line)) (program (car words)) + ;; Extract the file name from WORDS + ;; and put t in its place. + ;; Later on we will put the modified file name arg back there. (file-word (let ((w (cdr words))) (while (and w (= ?- (aref (car w) 0))) (setq w (cdr w))) - (car w))) + (prog1 (car w) + (setcar w t)))) (file-subst (and file-word (substitute-in-file-name file-word))) - (args (delq file-word (cdr words))) + (args (cdr words)) ;; If a directory was specified, expand the file name. ;; Otherwise, don't expand it, so GDB can use the PATH. ;; A file name without directory is literally valid @@ -1148,8 +1150,13 @@ (setq default-directory (file-name-directory file))) (or (bolp) (newline)) (insert "Current directory is " default-directory "\n") + ;; Put the substituted and expanded file name back in its place. + (let ((w args)) + (while (and w (not (eq (car w) t))) + (setq w (cdr w))) + (setcar w file)) (apply 'make-comint (concat "gud-" filepart) program nil - (if file-word (funcall massage-args file args)))) + (if file-word (funcall massage-args file args) args))) ;; Since comint clobbered the mode, we don't set it until now. (gud-mode) (make-local-variable 'gud-massage-args)