Commit dd8e46c7 authored by Richard M. Stallman's avatar Richard M. Stallman
Browse files

(gud-def): Fix inclusion of the define-key.

(gdb, sdb, dbx): Change bindings from letters to control chars.
(gud-common-init): Add save-excursion.
(gud-display-line): Don't mess with buffer-read-only.
(gud-filter): Set output-after-point *after* deleting old prompt.
parent f753e9aa
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
;; Version: 1.3 ;; Version: 1.3
;; Keywords: unix, tools ;; Keywords: unix, tools
;; Copyright (C) 1992 Free Software Foundation, Inc. ;; Copyright (C) 1992, 1993 Free Software Foundation, Inc.
;; This file is part of GNU Emacs. ;; This file is part of GNU Emacs.
...@@ -100,15 +100,14 @@ we're in the GUD buffer)." ...@@ -100,15 +100,14 @@ we're in the GUD buffer)."
'(interactive "p") '(interactive "p")
(list 'gud-call cmd 'arg)) (list 'gud-call cmd 'arg))
(if key (if key
(progn (list 'define-key
(list 'define-key '(current-local-map)
'(current-local-map) (concat "\C-c" key)
(concat "\C-c" key) (list 'quote func)))
(list 'quote func)) (if key
(list 'global-set-key (list 'global-set-key
(concat gud-key-prefix key) (concat gud-key-prefix key)
(list 'quote func)) (list 'quote func)))))
))))
;; Where gud-display-frame should put the debugging arrow. This is ;; Where gud-display-frame should put the debugging arrow. This is
;; set by the marker-filter, which scans the debugger's output for ;; set by the marker-filter, which scans the debugger's output for
...@@ -178,17 +177,17 @@ and source-file directory for your debugger." ...@@ -178,17 +177,17 @@ and source-file directory for your debugger."
(gud-common-init args) (gud-common-init args)
(gud-def gud-break "break %f:%l" "b" "Set breakpoint at current line.") (gud-def gud-break "break %f:%l" "\C-b" "Set breakpoint at current line.")
(gud-def gud-tbreak "tbreak %f:%l" "t" "Set breakpoint at current line.") (gud-def gud-tbreak "tbreak %f:%l" "\C-t" "Set breakpoint at current line.")
(gud-def gud-remove "clear %l" "d" "Remove breakpoint at current line") (gud-def gud-remove "clear %l" "\C-d" "Remove breakpoint at current line")
(gud-def gud-step "step %p" "s" "Step one source line with display.") (gud-def gud-step "step %p" "\C-s" "Step one source line with display.")
(gud-def gud-stepi "stepi %p" "i" "Step one instruction with display.") (gud-def gud-stepi "stepi %p" "\C-i" "Step one instruction with display.")
(gud-def gud-next "next %p" "n" "Step one line (skip functions).") (gud-def gud-next "next %p" "\C-n" "Step one line (skip functions).")
(gud-def gud-cont "cont" "r" "Continue with display.") (gud-def gud-cont "cont" "\C-r" "Continue with display.")
(gud-def gud-finish "finish" "f" "Finish executing current function.") (gud-def gud-finish "finish" "\C-f" "Finish executing current function.")
(gud-def gud-up "up %p" "<" "Up N stack frames (numeric arg).") (gud-def gud-up "up %p" "<" "Up N stack frames (numeric arg).")
(gud-def gud-down "down %p" ">" "Down N stack frames (numeric arg).") (gud-def gud-down "down %p" ">" "Down N stack frames (numeric arg).")
(gud-def gud-print "print %e" "p" "Evaluate C expression at point.") (gud-def gud-print "print %e" "\C-p" "Evaluate C expression at point.")
(setq comint-prompt-regexp "^(.*gdb[+]?) *") (setq comint-prompt-regexp "^(.*gdb[+]?) *")
(run-hooks 'gdb-mode-hook) (run-hooks 'gdb-mode-hook)
...@@ -252,14 +251,14 @@ and source-file directory for your debugger." ...@@ -252,14 +251,14 @@ and source-file directory for your debugger."
(gud-common-init args) (gud-common-init args)
(gud-def gud-break "%l b" "b" "Set breakpoint at current line.") (gud-def gud-break "%l b" "\C-b" "Set breakpoint at current line.")
(gud-def gud-tbreak "%l c" "t" "Set temporary breakpoint at current line.") (gud-def gud-tbreak "%l c" "\C-t" "Set temporary breakpoint at current line.")
(gud-def gud-remove "%l d" "d" "Remove breakpoint at current line") (gud-def gud-remove "%l d" "\C-d" "Remove breakpoint at current line")
(gud-def gud-step "s %p" "s" "Step one source line with display.") (gud-def gud-step "s %p" "\C-s" "Step one source line with display.")
(gud-def gud-stepi "i %p" "i" "Step one instruction with display.") (gud-def gud-stepi "i %p" "\C-i" "Step one instruction with display.")
(gud-def gud-next "S %p" "n" "Step one line (skip functions).") (gud-def gud-next "S %p" "\C-n" "Step one line (skip functions).")
(gud-def gud-cont "c" "r" "Continue with display.") (gud-def gud-cont "c" "\C-r" "Continue with display.")
(gud-def gud-print "%e/" "p" "Evaluate C expression at point.") (gud-def gud-print "%e/" "\C-p" "Evaluate C expression at point.")
(setq comint-prompt-regexp "\\(^\\|\n\\)\\*") (setq comint-prompt-regexp "\\(^\\|\n\\)\\*")
(run-hooks 'sdb-mode-hook) (run-hooks 'sdb-mode-hook)
...@@ -298,15 +297,15 @@ and source-file directory for your debugger." ...@@ -298,15 +297,15 @@ and source-file directory for your debugger."
(gud-common-init args) (gud-common-init args)
(gud-def gud-break "stop at \"%f\":%l" (gud-def gud-break "stop at \"%f\":%l"
"b" "Set breakpoint at current line.") "\C-b" "Set breakpoint at current line.")
(gud-def gud-remove "clear %l" "d" "Remove breakpoint at current line") (gud-def gud-remove "clear %l" "\C-d" "Remove breakpoint at current line")
(gud-def gud-step "step %p" "s" "Step one line with display.") (gud-def gud-step "step %p" "\C-s" "Step one line with display.")
(gud-def gud-stepi "stepi %p" "i" "Step one instruction with display.") (gud-def gud-stepi "stepi %p" "\C-i" "Step one instruction with display.")
(gud-def gud-next "next %p" "n" "Step one line (skip functions).") (gud-def gud-next "next %p" "\C-n" "Step one line (skip functions).")
(gud-def gud-cont "cont" "r" "Continue with display.") (gud-def gud-cont "cont" "\C-r" "Continue with display.")
(gud-def gud-up "up %p" "<" "Up (numeric arg) stack frames.") (gud-def gud-up "up %p" "<" "Up (numeric arg) stack frames.")
(gud-def gud-down "down %p" ">" "Down (numeric arg) stack frames.") (gud-def gud-down "down %p" ">" "Down (numeric arg) stack frames.")
(gud-def gud-print "print %e" "p" "Evaluate C expression at point.") (gud-def gud-print "print %e" "\C-p" "Evaluate C expression at point.")
(setq comint-prompt-regexp "^[^)]*dbx) *") (setq comint-prompt-regexp "^[^)]*dbx) *")
(run-hooks 'dbx-mode-hook) (run-hooks 'dbx-mode-hook)
...@@ -433,20 +432,21 @@ comint mode, which see." ...@@ -433,20 +432,21 @@ comint mode, which see."
(let (file i) (let (file i)
(if (string= args "") (if (string= args "")
(setq args nil) (setq args nil)
(set-buffer (get-buffer-create "*gud-scratch*")) (save-excursion
(erase-buffer) (set-buffer (get-buffer-create "*gud-scratch*"))
(insert args) (erase-buffer)
(goto-char (point-max)) (insert args)
(insert "\")") (goto-char (point-max))
(goto-char (point-min)) (insert "\")")
(insert "(\"") (goto-char (point-min))
(while (re-search-forward " +" nil t) (insert "(\"")
(replace-match "\" \"" nil nil)) (while (re-search-forward " +" nil t)
(goto-char (point-min)) (replace-match "\" \"" nil nil))
(while (re-search-forward "\"\"" nil t) (goto-char (point-min))
(replace-match "" nil nil)) (while (re-search-forward "\"\"" nil t)
(setq args (read (buffer-string))) (replace-match "" nil nil))
(kill-buffer (current-buffer))) (setq args (read (buffer-string)))
(kill-buffer (current-buffer))))
(setq i (1- (length args))) (setq i (1- (length args)))
(while (and (>= i 0) (not (= (aref (nth i args) 0) ?-))) (while (and (>= i 0) (not (= (aref (nth i args) 0) ?-)))
(setq file (nth i args)) (setq i (1- i))) (setq file (nth i args)) (setq i (1- i)))
...@@ -476,8 +476,7 @@ comint mode, which see." ...@@ -476,8 +476,7 @@ comint mode, which see."
(let ((inhibit-quit t)) (let ((inhibit-quit t))
(save-excursion (save-excursion
(set-buffer (process-buffer proc)) (set-buffer (process-buffer proc))
(let ((moving (= (point) (process-mark proc))) (let (moving output-after-point)
(output-after-point (< (point) (process-mark proc))))
(save-excursion (save-excursion
(goto-char (process-mark proc)) (goto-char (process-mark proc))
;; If we have been so requested, delete the debugger prompt. ;; If we have been so requested, delete the debugger prompt.
...@@ -486,6 +485,8 @@ comint mode, which see." ...@@ -486,6 +485,8 @@ comint mode, which see."
(delete-region (point) gud-delete-prompt-marker) (delete-region (point) gud-delete-prompt-marker)
(set-marker gud-delete-prompt-marker nil))) (set-marker gud-delete-prompt-marker nil)))
(insert-before-markers (gud-marker-filter string)) (insert-before-markers (gud-marker-filter string))
(setq moving (= (point) (process-mark proc)))
(setq output-after-point (< (point) (process-mark proc)))
;; Check for a filename-and-line number. ;; Check for a filename-and-line number.
;; Don't display the specified file ;; Don't display the specified file
;; unless (1) point is at or after the position where output appears ;; unless (1) point is at or after the position where output appears
...@@ -552,12 +553,12 @@ Obeying it means displaying in another window the specified file and line." ...@@ -552,12 +553,12 @@ Obeying it means displaying in another window the specified file and line."
(let* ((buffer (gud-find-file true-file)) (let* ((buffer (gud-find-file true-file))
(window (display-buffer buffer)) (window (display-buffer buffer))
(pos)) (pos))
(if (equal buffer (current-buffer)) ;;; (if (equal buffer (current-buffer))
nil ;;; nil
(setq buffer-read-only nil)) ;;; (setq buffer-read-only nil))
(save-excursion (save-excursion
;;; (setq buffer-read-only t)
(set-buffer buffer) (set-buffer buffer)
(setq buffer-read-only t)
(save-restriction (save-restriction
(widen) (widen)
(goto-line line) (goto-line line)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment