Mercurial > emacs
comparison lisp/gud.el @ 16327:2239440f2f00
(gud-perldb-massage-args): Handle -e in ARGS.
(gud-perldb-marker-filter): Handle drive letters in file name.
(perldb): Update comint-prompt-regexp for latest Perl.
(gud-mode): Locally set comint-input-ignoredups to t.
author | Richard M. Stallman <rms@gnu.org> |
---|---|
date | Wed, 25 Sep 1996 07:17:18 +0000 |
parents | aaa0ecdc4772 |
children | 0a969fac6f65 |
comparison
equal
deleted
inserted
replaced
16326:a85909645f7a | 16327:2239440f2f00 |
---|---|
926 | 926 |
927 ;;; History of argument lists passed to perldb. | 927 ;;; History of argument lists passed to perldb. |
928 (defvar gud-perldb-history nil) | 928 (defvar gud-perldb-history nil) |
929 | 929 |
930 (defun gud-perldb-massage-args (file args) | 930 (defun gud-perldb-massage-args (file args) |
931 (cons "-d" (cons (car args) (cons "-emacs" (cdr args))))) | 931 (cond ((equal (car args) "-e") |
932 (cons "-d" | |
933 (cons (car args) | |
934 (cons (nth 1 args) | |
935 (cons "--" (cons "-emacs" (cdr (cdr args)))))))) | |
936 (t | |
937 (cons "-d" (cons (car args) (cons "-emacs" (cdr args))))))) | |
932 | 938 |
933 ;; There's no guarantee that Emacs will hand the filter the entire | 939 ;; There's no guarantee that Emacs will hand the filter the entire |
934 ;; marker at once; it could be broken up across several strings. We | 940 ;; marker at once; it could be broken up across several strings. We |
935 ;; might even receive a big chunk with several markers in it. If we | 941 ;; might even receive a big chunk with several markers in it. If we |
936 ;; receive a chunk of text which looks like it might contain the | 942 ;; receive a chunk of text which looks like it might contain the |
941 (defun gud-perldb-marker-filter (string) | 947 (defun gud-perldb-marker-filter (string) |
942 (setq gud-marker-acc (concat gud-marker-acc string)) | 948 (setq gud-marker-acc (concat gud-marker-acc string)) |
943 (let ((output "")) | 949 (let ((output "")) |
944 | 950 |
945 ;; Process all the complete markers in this chunk. | 951 ;; Process all the complete markers in this chunk. |
946 (while (string-match "\032\032\\([^:\n]*\\):\\([0-9]*\\):.*\n" | 952 (while (string-match "\032\032\\(\\([a-zA-Z]:\\)?[^:\n]*\\):\\([0-9]*\\):.*\n" |
947 gud-marker-acc) | 953 gud-marker-acc) |
948 (setq | 954 (setq |
949 | 955 |
950 ;; Extract the frame position from the marker. | 956 ;; Extract the frame position from the marker. |
951 gud-last-frame | 957 gud-last-frame |
952 (cons (substring gud-marker-acc (match-beginning 1) (match-end 1)) | 958 (cons (substring gud-marker-acc (match-beginning 1) (match-end 1)) |
953 (string-to-int (substring gud-marker-acc | 959 (string-to-int (substring gud-marker-acc |
954 (match-beginning 2) | 960 (match-beginning 3) |
955 (match-end 2)))) | 961 (match-end 3)))) |
956 | 962 |
957 ;; Append any text before the marker to the output we're going | 963 ;; Append any text before the marker to the output we're going |
958 ;; to return - we don't include the marker in this text. | 964 ;; to return - we don't include the marker in this text. |
959 output (concat output | 965 output (concat output |
960 (substring gud-marker-acc 0 (match-beginning 0))) | 966 (substring gud-marker-acc 0 (match-beginning 0))) |
1016 ; (gud-def gud-finish "finish" "\C-f" "Finish executing current function.") | 1022 ; (gud-def gud-finish "finish" "\C-f" "Finish executing current function.") |
1017 ; (gud-def gud-up "up %p" "<" "Up N stack frames (numeric arg).") | 1023 ; (gud-def gud-up "up %p" "<" "Up N stack frames (numeric arg).") |
1018 ; (gud-def gud-down "down %p" ">" "Down N stack frames (numeric arg).") | 1024 ; (gud-def gud-down "down %p" ">" "Down N stack frames (numeric arg).") |
1019 (gud-def gud-print "%e" "\C-p" "Evaluate perl expression at point.") | 1025 (gud-def gud-print "%e" "\C-p" "Evaluate perl expression at point.") |
1020 | 1026 |
1021 (setq comint-prompt-regexp "^ DB<[0-9]+> ") | 1027 (setq comint-prompt-regexp "^ DB<+[0-9]+>+ ") |
1022 (setq paragraph-start comint-prompt-regexp) | 1028 (setq paragraph-start comint-prompt-regexp) |
1023 (run-hooks 'perldb-mode-hook) | 1029 (run-hooks 'perldb-mode-hook) |
1024 ) | 1030 ) |
1025 | 1031 |
1026 ;; | 1032 ;; |
1134 (gud-make-debug-menu) | 1140 (gud-make-debug-menu) |
1135 (define-key (current-local-map) "\C-c\C-l" 'gud-refresh) | 1141 (define-key (current-local-map) "\C-c\C-l" 'gud-refresh) |
1136 (make-local-variable 'gud-last-frame) | 1142 (make-local-variable 'gud-last-frame) |
1137 (setq gud-last-frame nil) | 1143 (setq gud-last-frame nil) |
1138 (make-local-variable 'comint-prompt-regexp) | 1144 (make-local-variable 'comint-prompt-regexp) |
1145 ;; Don't put repeated commands in command history many times. | |
1146 (make-local-variable 'comint-input-ignoredups) | |
1147 (setq comint-input-ignoredups t) | |
1139 (make-local-variable 'paragraph-start) | 1148 (make-local-variable 'paragraph-start) |
1140 (make-local-variable 'gud-delete-prompt-marker) | 1149 (make-local-variable 'gud-delete-prompt-marker) |
1141 (setq gud-delete-prompt-marker (make-marker)) | 1150 (setq gud-delete-prompt-marker (make-marker)) |
1142 (run-hooks 'gud-mode-hook)) | 1151 (run-hooks 'gud-mode-hook)) |
1143 | 1152 |