aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGlenn Morris2011-03-09 00:43:27 -0800
committerGlenn Morris2011-03-09 00:43:27 -0800
commit13522cb4cd1e954ae1523c309c778137a2ce98bd (patch)
tree0ea06baab4149d81e6a73a1d2a41ab4e38e666a7
parent80b005c7673c45feeb45c8bda9778deaddb9b9a3 (diff)
downloademacs-13522cb4cd1e954ae1523c309c778137a2ce98bd.tar.gz
emacs-13522cb4cd1e954ae1523c309c778137a2ce98bd.zip
gdb-mi addition for bug#7889.
* lisp/progmodes/gdb-mi.el (gdb): Improve 2010-12-08 change. Check for GDBHISTFILE, HISTSIZE, etc.
-rw-r--r--lisp/ChangeLog5
-rw-r--r--lisp/progmodes/gdb-mi.el43
2 files changed, 33 insertions, 15 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 7963e3432cb..253d47364f8 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,8 @@
12011-03-09 Glenn Morris <rgm@gnu.org>
2
3 * progmodes/gdb-mi.el (gdb): Improve 2010-12-08 change.
4 Check for GDBHISTFILE, HISTSIZE, etc. (Bug#7889)
5
12011-03-08 Chong Yidong <cyd@stupidchicken.com> 62011-03-08 Chong Yidong <cyd@stupidchicken.com>
2 7
3 * emacs-lisp/package.el (package-refresh-contents) 8 * emacs-lisp/package.el (package-refresh-contents)
diff --git a/lisp/progmodes/gdb-mi.el b/lisp/progmodes/gdb-mi.el
index 25d1410621a..ac76caf8d61 100644
--- a/lisp/progmodes/gdb-mi.el
+++ b/lisp/progmodes/gdb-mi.el
@@ -648,21 +648,34 @@ detailed description of this mode.
648 (set (make-local-variable 'gud-minor-mode) 'gdbmi) 648 (set (make-local-variable 'gud-minor-mode) 'gdbmi)
649 (setq comint-input-sender 'gdb-send) 649 (setq comint-input-sender 'gdb-send)
650 (when (ring-empty-p comint-input-ring) ; cf shell-mode 650 (when (ring-empty-p comint-input-ring) ; cf shell-mode
651 (let (hfile) 651 (let ((hfile (expand-file-name (or (getenv "GBDHISTFILE")
652 (when (catch 'done 652 (if (eq system-type 'ms-dos)
653 (dolist (file '(".gdbinit" "~/.gdbinit")) 653 "_gdb_history"
654 (if (file-readable-p (setq file (expand-file-name file))) 654 ".gdb_history"))))
655 (with-temp-buffer 655 ;; gdb defaults to 256, but we'll default to comint-input-ring-size.
656 (insert-file-contents file) 656 (hsize (getenv "HISTSIZE")))
657 (and (re-search-forward 657 (dolist (file (append '("~/.gdbinit")
658 "^ *set history filename *\\(.*\\)" nil t) 658 (unless (string-equal (expand-file-name ".")
659 (file-readable-p 659 (expand-file-name "~"))
660 (setq hfile (expand-file-name 660 '(".gdbinit"))))
661 (match-string 1) 661 (if (file-readable-p (setq file (expand-file-name file)))
662 (file-name-directory file)))) 662 (with-temp-buffer
663 (throw 'done t)))))) 663 (insert-file-contents file)
664 (set (make-local-variable 'comint-input-ring-file-name) hfile) 664 ;; TODO? check for "set history save\\( *on\\)?" and do
665 (comint-read-input-ring t)))) 665 ;; not use history otherwise?
666 (while (re-search-forward
667 "^ *set history \\(filename\\|size\\) *\\(.*\\)" nil t)
668 (cond ((string-equal (match-string 1) "filename")
669 (setq hfile (expand-file-name
670 (match-string 2)
671 (file-name-directory file))))
672 ((string-equal (match-string 1) "size")
673 (setq hsize (match-string 2))))))))
674 (if (integerp hsize)
675 (set (make-local-variable 'comint-input-ring-size) hsize))
676 (if (stringp hfile)
677 (set (make-local-variable 'comint-input-ring-file-name) hfile))
678 (comint-read-input-ring t)))
666 (gud-def gud-tbreak "tbreak %f:%l" "\C-t" 679 (gud-def gud-tbreak "tbreak %f:%l" "\C-t"
667 "Set temporary breakpoint at current line.") 680 "Set temporary breakpoint at current line.")
668 (gud-def gud-jump 681 (gud-def gud-jump