diff options
| -rw-r--r-- | lisp/gud.el | 29 |
1 files changed, 18 insertions, 11 deletions
diff --git a/lisp/gud.el b/lisp/gud.el index 5d321369cf1..3dff754f966 100644 --- a/lisp/gud.el +++ b/lisp/gud.el | |||
| @@ -173,7 +173,7 @@ we're in the GUD buffer)." | |||
| 173 | (defvar gud-gdb-history nil) | 173 | (defvar gud-gdb-history nil) |
| 174 | 174 | ||
| 175 | (defun gud-gdb-massage-args (file args) | 175 | (defun gud-gdb-massage-args (file args) |
| 176 | (cons "-fullname" (cons file args))) | 176 | (cons "-fullname" args)) |
| 177 | 177 | ||
| 178 | ;; There's no guarantee that Emacs will hand the filter the entire | 178 | ;; There's no guarantee that Emacs will hand the filter the entire |
| 179 | ;; marker at once; it could be broken up across several strings. We | 179 | ;; marker at once; it could be broken up across several strings. We |
| @@ -395,8 +395,7 @@ available with older versions of GDB." | |||
| 395 | 395 | ||
| 396 | (defvar gud-sdb-lastfile nil) | 396 | (defvar gud-sdb-lastfile nil) |
| 397 | 397 | ||
| 398 | (defun gud-sdb-massage-args (file args) | 398 | (defun gud-sdb-massage-args (file args) args) |
| 399 | (cons file args)) | ||
| 400 | 399 | ||
| 401 | (defun gud-sdb-marker-filter (string) | 400 | (defun gud-sdb-marker-filter (string) |
| 402 | (setq gud-marker-acc | 401 | (setq gud-marker-acc |
| @@ -507,8 +506,7 @@ and source-file directory for your debugger." | |||
| 507 | ;;; History of argument lists passed to dbx. | 506 | ;;; History of argument lists passed to dbx. |
| 508 | (defvar gud-dbx-history nil) | 507 | (defvar gud-dbx-history nil) |
| 509 | 508 | ||
| 510 | (defun gud-dbx-massage-args (file args) | 509 | (defun gud-dbx-massage-args (file args) args) |
| 511 | (cons file args)) | ||
| 512 | 510 | ||
| 513 | (defun gud-dbx-marker-filter (string) | 511 | (defun gud-dbx-marker-filter (string) |
| 514 | (setq gud-marker-acc (if gud-marker-acc (concat gud-marker-acc string) string)) | 512 | (setq gud-marker-acc (if gud-marker-acc (concat gud-marker-acc string) string)) |
| @@ -553,7 +551,7 @@ and source-file directory for your debugger." | |||
| 553 | "Non-nil to assume the MIPS/OSF dbx conventions (argument `-emacs').") | 551 | "Non-nil to assume the MIPS/OSF dbx conventions (argument `-emacs').") |
| 554 | 552 | ||
| 555 | (defun gud-mipsdbx-massage-args (file args) | 553 | (defun gud-mipsdbx-massage-args (file args) |
| 556 | (cons "-emacs" (cons file args))) | 554 | (cons "-emacs" args)) |
| 557 | 555 | ||
| 558 | ;; This is just like the gdb one except for the regexps since we need to cope | 556 | ;; This is just like the gdb one except for the regexps since we need to cope |
| 559 | ;; with an optional breakpoint number in [] before the ^Z^Z | 557 | ;; with an optional breakpoint number in [] before the ^Z^Z |
| @@ -781,7 +779,7 @@ containing the executable being debugged.") | |||
| 781 | (while directories | 779 | (while directories |
| 782 | (setq result (cons (car directories) (cons "-d" result))) | 780 | (setq result (cons (car directories) (cons "-d" result))) |
| 783 | (setq directories (cdr directories))) | 781 | (setq directories (cdr directories))) |
| 784 | (nreverse (cons file result))) | 782 | (nreverse result)) |
| 785 | args)) | 783 | args)) |
| 786 | 784 | ||
| 787 | (defun gud-xdb-file-name (f) | 785 | (defun gud-xdb-file-name (f) |
| @@ -883,7 +881,7 @@ directories if your program contains sources from more than one directory." | |||
| 883 | (defvar gud-perldb-history nil) | 881 | (defvar gud-perldb-history nil) |
| 884 | 882 | ||
| 885 | (defun gud-perldb-massage-args (file args) | 883 | (defun gud-perldb-massage-args (file args) |
| 886 | (cons "-d" (cons file (cons "-emacs" args)))) | 884 | (cons "-d" (cons "-emacs" args))) |
| 887 | 885 | ||
| 888 | ;; There's no guarantee that Emacs will hand the filter the entire | 886 | ;; There's no guarantee that Emacs will hand the filter the entire |
| 889 | ;; marker at once; it could be broken up across several strings. We | 887 | ;; marker at once; it could be broken up across several strings. We |
| @@ -1119,13 +1117,17 @@ comint mode, which see." | |||
| 1119 | (defun gud-common-init (command-line massage-args marker-filter find-file) | 1117 | (defun gud-common-init (command-line massage-args marker-filter find-file) |
| 1120 | (let* ((words (gud-chop-words command-line)) | 1118 | (let* ((words (gud-chop-words command-line)) |
| 1121 | (program (car words)) | 1119 | (program (car words)) |
| 1120 | ;; Extract the file name from WORDS | ||
| 1121 | ;; and put t in its place. | ||
| 1122 | ;; Later on we will put the modified file name arg back there. | ||
| 1122 | (file-word (let ((w (cdr words))) | 1123 | (file-word (let ((w (cdr words))) |
| 1123 | (while (and w (= ?- (aref (car w) 0))) | 1124 | (while (and w (= ?- (aref (car w) 0))) |
| 1124 | (setq w (cdr w))) | 1125 | (setq w (cdr w))) |
| 1125 | (car w))) | 1126 | (prog1 (car w) |
| 1127 | (setcar w t)))) | ||
| 1126 | (file-subst | 1128 | (file-subst |
| 1127 | (and file-word (substitute-in-file-name file-word))) | 1129 | (and file-word (substitute-in-file-name file-word))) |
| 1128 | (args (delq file-word (cdr words))) | 1130 | (args (cdr words)) |
| 1129 | ;; If a directory was specified, expand the file name. | 1131 | ;; If a directory was specified, expand the file name. |
| 1130 | ;; Otherwise, don't expand it, so GDB can use the PATH. | 1132 | ;; Otherwise, don't expand it, so GDB can use the PATH. |
| 1131 | ;; A file name without directory is literally valid | 1133 | ;; A file name without directory is literally valid |
| @@ -1148,8 +1150,13 @@ comint mode, which see." | |||
| 1148 | (setq default-directory (file-name-directory file))) | 1150 | (setq default-directory (file-name-directory file))) |
| 1149 | (or (bolp) (newline)) | 1151 | (or (bolp) (newline)) |
| 1150 | (insert "Current directory is " default-directory "\n") | 1152 | (insert "Current directory is " default-directory "\n") |
| 1153 | ;; Put the substituted and expanded file name back in its place. | ||
| 1154 | (let ((w args)) | ||
| 1155 | (while (and w (not (eq (car w) t))) | ||
| 1156 | (setq w (cdr w))) | ||
| 1157 | (setcar w file)) | ||
| 1151 | (apply 'make-comint (concat "gud-" filepart) program nil | 1158 | (apply 'make-comint (concat "gud-" filepart) program nil |
| 1152 | (if file-word (funcall massage-args file args)))) | 1159 | (if file-word (funcall massage-args file args) args))) |
| 1153 | ;; Since comint clobbered the mode, we don't set it until now. | 1160 | ;; Since comint clobbered the mode, we don't set it until now. |
| 1154 | (gud-mode) | 1161 | (gud-mode) |
| 1155 | (make-local-variable 'gud-massage-args) | 1162 | (make-local-variable 'gud-massage-args) |