aboutsummaryrefslogtreecommitdiffstats
path: root/lisp/progmodes
diff options
context:
space:
mode:
authorKaroly Lorentey2006-02-23 03:17:52 +0000
committerKaroly Lorentey2006-02-23 03:17:52 +0000
commit5a5654159aeca7b60bfceb8d68f4add0570efc7a (patch)
treeeb9da5ea0ca4c025dc76a66eb1ede78a1cc88bc7 /lisp/progmodes
parent5f3c1a63f31f77f60b8a60518ce3eda6a51f72b9 (diff)
parente75116edb6280346c671aa5a5c022776b0ca1c01 (diff)
downloademacs-5a5654159aeca7b60bfceb8d68f4add0570efc7a.tar.gz
emacs-5a5654159aeca7b60bfceb8d68f4add0570efc7a.zip
Merged from emacs@sv.gnu.org
Patches applied: * emacs@sv.gnu.org/emacs--devo--0--patch-111 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-112 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-113 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-114 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-115 Update from CVS git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-518
Diffstat (limited to 'lisp/progmodes')
-rw-r--r--lisp/progmodes/gdb-ui.el58
-rw-r--r--lisp/progmodes/sh-script.el10
2 files changed, 47 insertions, 21 deletions
diff --git a/lisp/progmodes/gdb-ui.el b/lisp/progmodes/gdb-ui.el
index df603dc0d74..7e0cda786c7 100644
--- a/lisp/progmodes/gdb-ui.el
+++ b/lisp/progmodes/gdb-ui.el
@@ -123,6 +123,7 @@ and #define directives otherwise.")
123(defvar gdb-macro-info nil 123(defvar gdb-macro-info nil
124 "Non-nil if GDB knows that the inferior includes preprocessor macro info.") 124 "Non-nil if GDB knows that the inferior includes preprocessor macro info.")
125(defvar gdb-buffer-fringe-width nil) 125(defvar gdb-buffer-fringe-width nil)
126(defvar gdb-signalled nil)
126 127
127(defvar gdb-buffer-type nil 128(defvar gdb-buffer-type nil
128 "One of the symbols bound in `gdb-buffer-rules'.") 129 "One of the symbols bound in `gdb-buffer-rules'.")
@@ -258,11 +259,20 @@ detailed description of this mode.
258 (gdb command-line) 259 (gdb command-line)
259 (gdb-init-1)) 260 (gdb-init-1))
260 261
261(defvar gdb-debug-log nil) 262(defcustom gdb-debug-log-length 128
263 "Length of `gdb-debug-log-ring'."
264 :group 'gud
265 :type 'integer
266 :version "22.1")
267
268(defvar gdb-debug-log-ring (make-ring gdb-debug-log-length)
269 "Ring of commands sent to and replies received from GDB.
270This variable is used to debug GDB-UI. Just need most recent
271messages and a ring limits the size.")
262 272
263;;;###autoload 273;;;###autoload
264(defcustom gdb-enable-debug-log nil 274(defcustom gdb-enable-debug-log nil
265 "Non-nil means record the process input and output in `gdb-debug-log'." 275 "Non-nil means record the process input and output in `gdb-debug-log-ring'."
266 :type 'boolean 276 :type 'boolean
267 :group 'gud 277 :group 'gud
268 :version "22.1") 278 :version "22.1")
@@ -390,7 +400,6 @@ With arg, use separate IO iff arg is positive."
390 expr)) 400 expr))
391 401
392(defun gdb-init-1 () 402(defun gdb-init-1 ()
393 (setq gdb-debug-log nil)
394 (set (make-local-variable 'gud-minor-mode) 'gdba) 403 (set (make-local-variable 'gud-minor-mode) 'gdba)
395 (set (make-local-variable 'gud-marker-filter) 'gud-gdba-marker-filter) 404 (set (make-local-variable 'gud-marker-filter) 'gud-gdba-marker-filter)
396 ;; 405 ;;
@@ -469,14 +478,15 @@ With arg, use separate IO iff arg is positive."
469 gdb-source-file-list nil 478 gdb-source-file-list nil
470 gdb-error nil 479 gdb-error nil
471 gdb-macro-info nil 480 gdb-macro-info nil
472 gdb-buffer-fringe-width (car (window-fringes))) 481 gdb-buffer-fringe-width (car (window-fringes))
482 gdb-debug-log-ring (make-ring gdb-debug-log-length)
483 gdb-signalled nil)
473 484
474 (setq gdb-buffer-type 'gdba) 485 (setq gdb-buffer-type 'gdba)
475 486
476 (if gdb-use-separate-io-buffer (gdb-clear-inferior-io)) 487 (if gdb-use-separate-io-buffer (gdb-clear-inferior-io))
477 488
478 ;; Hack to see test for GDB 6.4+ (-stack-info-frame was implemented in 6.4) 489 ;; Hack to see test for GDB 6.4+ (-stack-info-frame was implemented in 6.4)
479 (setq gdb-version nil)
480 (gdb-enqueue-input (list "server interpreter mi -stack-info-frame\n" 490 (gdb-enqueue-input (list "server interpreter mi -stack-info-frame\n"
481 'gdb-get-version))) 491 'gdb-get-version)))
482 492
@@ -573,9 +583,6 @@ With arg, automatically raise speedbar iff arg is positive."
573 (require 'tooltip) 583 (require 'tooltip)
574 (save-selected-window 584 (save-selected-window
575 (let ((expr (tooltip-identifier-from-point (point)))) 585 (let ((expr (tooltip-identifier-from-point (point))))
576 (if (and (string-equal gdb-current-language "c")
577 gdb-use-colon-colon-notation gdb-selected-frame)
578 (setq expr (concat gdb-selected-frame "::" expr)))
579 (catch 'already-watched 586 (catch 'already-watched
580 (dolist (var gdb-var-list) 587 (dolist (var gdb-var-list)
581 (if (string-equal expr (car var)) (throw 'already-watched nil))) 588 (if (string-equal expr (car var)) (throw 'already-watched nil)))
@@ -593,11 +600,15 @@ With arg, automatically raise speedbar iff arg is positive."
593(defun gdb-var-create-handler (expr) 600(defun gdb-var-create-handler (expr)
594 (goto-char (point-min)) 601 (goto-char (point-min))
595 (if (re-search-forward gdb-var-create-regexp nil t) 602 (if (re-search-forward gdb-var-create-regexp nil t)
596 (let ((var (list expr 603 (let ((var (list
597 (match-string 1) 604 (if (and (string-equal gdb-current-language "c")
598 (match-string 2) 605 gdb-use-colon-colon-notation gdb-selected-frame)
599 (match-string 3) 606 (setq expr (concat gdb-selected-frame "::" expr))
600 nil nil))) 607 expr)
608 (match-string 1)
609 (match-string 2)
610 (match-string 3)
611 nil nil)))
601 (push var gdb-var-list) 612 (push var gdb-var-list)
602 (speedbar 1) 613 (speedbar 1)
603 (unless (string-equal 614 (unless (string-equal
@@ -613,7 +624,7 @@ With arg, automatically raise speedbar iff arg is positive."
613 ,(nth 1 var) nil))))) 624 ,(nth 1 var) nil)))))
614 (if (search-forward "Undefined command" nil t) 625 (if (search-forward "Undefined command" nil t)
615 (message-box "Watching expressions requires gdb 6.0 onwards") 626 (message-box "Watching expressions requires gdb 6.0 onwards")
616 (message "No symbol \"%s\" in current context." expr)))) 627 (message-box "No symbol \"%s\" in current context." expr))))
617 628
618(defun gdb-var-evaluate-expression-handler (varnum changed) 629(defun gdb-var-evaluate-expression-handler (varnum changed)
619 (goto-char (point-min)) 630 (goto-char (point-min))
@@ -864,7 +875,7 @@ The key should be one of the cars in `gdb-buffer-rules-assoc'."
864 "*")) 875 "*"))
865 876
866(defun gdb-display-separate-io-buffer () 877(defun gdb-display-separate-io-buffer ()
867 "Display IO of inferior in a separate window." 878 "Display IO of debugged program in a separate window."
868 (interactive) 879 (interactive)
869 (if gdb-use-separate-io-buffer 880 (if gdb-use-separate-io-buffer
870 (gdb-display-buffer 881 (gdb-display-buffer
@@ -963,7 +974,7 @@ This filter may simply queue input for a later time."
963 (let ((item (concat string "\n"))) 974 (let ((item (concat string "\n")))
964 (if gud-running 975 (if gud-running
965 (progn 976 (progn
966 (if gdb-enable-debug-log (push (cons 'send item) gdb-debug-log)) 977 (if gdb-enable-debug-log (push (cons 'send item) gdb-debug-log-ring))
967 (process-send-string proc item)) 978 (process-send-string proc item))
968 (gdb-enqueue-input item)))) 979 (gdb-enqueue-input item))))
969 980
@@ -986,7 +997,8 @@ This filter may simply queue input for a later time."
986 997
987(defun gdb-send-item (item) 998(defun gdb-send-item (item)
988 (setq gdb-flush-pending-output nil) 999 (setq gdb-flush-pending-output nil)
989 (if gdb-enable-debug-log (push (cons 'send-item item) gdb-debug-log)) 1000 (if gdb-enable-debug-log
1001 (ring-insert gdb-debug-log-ring (cons 'send-item item)))
990 (setq gdb-current-item item) 1002 (setq gdb-current-item item)
991 (let ((process (get-buffer-process gud-comint-buffer))) 1003 (let ((process (get-buffer-process gud-comint-buffer)))
992 (if (eq (buffer-local-value 'gud-minor-mode gud-comint-buffer) 'gdba) 1004 (if (eq (buffer-local-value 'gud-minor-mode gud-comint-buffer) 'gdba)
@@ -1039,7 +1051,7 @@ This filter may simply queue input for a later time."
1039 ("source" gdb-source) 1051 ("source" gdb-source)
1040 ("starting" gdb-starting) 1052 ("starting" gdb-starting)
1041 ("exited" gdb-exited) 1053 ("exited" gdb-exited)
1042 ("signalled" gdb-exited) 1054 ("signalled" gdb-signalled)
1043 ("signal" gdb-stopping) 1055 ("signal" gdb-stopping)
1044 ("breakpoint" gdb-stopping) 1056 ("breakpoint" gdb-stopping)
1045 ("watchpoint" gdb-stopping) 1057 ("watchpoint" gdb-stopping)
@@ -1156,6 +1168,9 @@ directives."
1156 (setq gdb-overlay-arrow-position nil) 1168 (setq gdb-overlay-arrow-position nil)
1157 (gdb-stopping ignored)) 1169 (gdb-stopping ignored))
1158 1170
1171(defun gdb-signalled (ignored)
1172 (setq gdb-signalled t))
1173
1159(defun gdb-frame-begin (ignored) 1174(defun gdb-frame-begin (ignored)
1160 (let ((sink gdb-output-sink)) 1175 (let ((sink gdb-output-sink))
1161 (cond 1176 (cond
@@ -1172,7 +1187,6 @@ directives."
1172It is just like `gdb-stopping', except that if we already set the output 1187It is just like `gdb-stopping', except that if we already set the output
1173sink to `user' in `gdb-stopping', that is fine." 1188sink to `user' in `gdb-stopping', that is fine."
1174 (setq gud-running nil) 1189 (setq gud-running nil)
1175 (setq gdb-active-process t)
1176 (let ((sink gdb-output-sink)) 1190 (let ((sink gdb-output-sink))
1177 (cond 1191 (cond
1178 ((eq sink 'inferior) 1192 ((eq sink 'inferior)
@@ -1180,7 +1194,8 @@ sink to `user' in `gdb-stopping', that is fine."
1180 ((eq sink 'user) t) 1194 ((eq sink 'user) t)
1181 (t 1195 (t
1182 (gdb-resync) 1196 (gdb-resync)
1183 (error "Unexpected stopped annotation"))))) 1197 (error "Unexpected stopped annotation"))))
1198 (if gdb-signalled (gdb-exited ignored)))
1184 1199
1185(defun gdb-error (ignored) 1200(defun gdb-error (ignored)
1186 (setq gdb-error (not gdb-error))) 1201 (setq gdb-error (not gdb-error)))
@@ -1233,7 +1248,8 @@ happens to be appropriate."
1233 "A gud marker filter for gdb. Handle a burst of output from GDB." 1248 "A gud marker filter for gdb. Handle a burst of output from GDB."
1234 (if gdb-flush-pending-output 1249 (if gdb-flush-pending-output
1235 nil 1250 nil
1236 (if gdb-enable-debug-log (push (cons 'recv string) gdb-debug-log)) 1251 (if gdb-enable-debug-log
1252 (ring-insert gdb-debug-log-ring (cons 'recv string)))
1237 ;; Recall the left over gud-marker-acc from last time. 1253 ;; Recall the left over gud-marker-acc from last time.
1238 (setq gud-marker-acc (concat gud-marker-acc string)) 1254 (setq gud-marker-acc (concat gud-marker-acc string))
1239 ;; Start accumulating output for the GUD buffer. 1255 ;; Start accumulating output for the GUD buffer.
diff --git a/lisp/progmodes/sh-script.el b/lisp/progmodes/sh-script.el
index e331268391a..02ce4a21c97 100644
--- a/lisp/progmodes/sh-script.el
+++ b/lisp/progmodes/sh-script.el
@@ -1438,6 +1438,16 @@ with your script for an edit-interpret-debug cycle."
1438 ((and buffer-file-name 1438 ((and buffer-file-name
1439 (string-match "\\.m?spec\\'" buffer-file-name)) 1439 (string-match "\\.m?spec\\'" buffer-file-name))
1440 "rpm"))))) 1440 "rpm")))))
1441 (unless interpreter
1442 (setq interpreter
1443 (cond ((string-match "[.]sh\\>" buffer-file-name)
1444 "sh")
1445 ((string-match "[.]bash\\>" buffer-file-name)
1446 "bash")
1447 ((string-match "[.]ksh\\>" buffer-file-name)
1448 "ksh")
1449 ((string-match "[.]csh\\>" buffer-file-name)
1450 "csh"))))
1441 (sh-set-shell (or interpreter sh-shell-file) nil nil)) 1451 (sh-set-shell (or interpreter sh-shell-file) nil nil))
1442 (run-mode-hooks 'sh-mode-hook)) 1452 (run-mode-hooks 'sh-mode-hook))
1443 1453