comparison lisp/progmodes/gdb-ui.el @ 83517:b6689e223e2f

Merged from emacs@sv.gnu.org Patches applied: * emacs@sv.gnu.org/emacs--devo--0--patch-273 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-274 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-275 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-276 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-277 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-278 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-279 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-280 Update etc/MORE.STUFF. * emacs@sv.gnu.org/emacs--devo--0--patch-281 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-282 Update from CVS * emacs@sv.gnu.org/emacs--devo--0--patch-283 Merge from gnus--rel--5.10 * emacs@sv.gnu.org/emacs--devo--0--patch-284 Update from CVS * emacs@sv.gnu.org/gnus--rel--5.10--patch-101 Update from CVS git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-557
author Karoly Lorentey <lorentey@elte.hu>
date Wed, 17 May 2006 18:05:02 +0000
parents 1321f6cfb389 5bf70421e7ea
children 46b1096093f5
comparison
equal deleted inserted replaced
83516:1321f6cfb389 83517:b6689e223e2f
730 speedbar-initial-expansion-list-name "GUD") 730 speedbar-initial-expansion-list-name "GUD")
731 (speedbar-change-initial-expansion-list "GUD")) 731 (speedbar-change-initial-expansion-list "GUD"))
732 (gdb-enqueue-input 732 (gdb-enqueue-input
733 (list 733 (list
734 (if (eq (buffer-local-value 'gud-minor-mode gud-comint-buffer) 'gdba) 734 (if (eq (buffer-local-value 'gud-minor-mode gud-comint-buffer) 'gdba)
735 (concat "server interpreter mi \"-var-evaluate-expression " 735 (concat "server interpreter mi \"0-var-evaluate-expression "
736 (car var) "\"\n") 736 (car var) "\"\n")
737 (concat "-var-evaluate-expression " (car var) "\n")) 737 (concat "0-var-evaluate-expression " (car var) "\n"))
738 `(lambda () (gdb-var-evaluate-expression-handler 738 `(lambda () (gdb-var-evaluate-expression-handler
739 ,(car var) nil))))) 739 ,(car var) nil)))))
740 (if (search-forward "Undefined command" nil t) 740 (if (search-forward "Undefined command" nil t)
741 (message-box "Watching expressions requires gdb 6.0 onwards") 741 (message-box "Watching expressions requires gdb 6.0 onwards")
742 (message-box "No symbol \"%s\" in current context." expr)))) 742 (message-box "No symbol \"%s\" in current context." expr))))
753 (delq 'gdb-speedbar-timer gdb-pending-triggers)) 753 (delq 'gdb-speedbar-timer gdb-pending-triggers))
754 (speedbar-timer-fn)) 754 (speedbar-timer-fn))
755 755
756 (defun gdb-var-evaluate-expression-handler (varnum changed) 756 (defun gdb-var-evaluate-expression-handler (varnum changed)
757 (goto-char (point-min)) 757 (goto-char (point-min))
758 (re-search-forward ".*value=\\(\".*\"\\)" nil t) 758 (re-search-forward "\\(.+\\)\\^done,value=\\(\".*\"\\)" nil t)
759 (setq gdb-pending-triggers
760 (delq (string-to-number (match-string 1)) gdb-pending-triggers))
759 (let ((var (assoc varnum gdb-var-list))) 761 (let ((var (assoc varnum gdb-var-list)))
760 (when var 762 (when var
761 (if changed (setcar (nthcdr 5 var) 'changed)) 763 (if changed (setcar (nthcdr 5 var) 'changed))
762 (setcar (nthcdr 4 var) (read (match-string 1))))) 764 (setcar (nthcdr 4 var) (read (match-string 2)))))
763 (gdb-speedbar-update)) 765 (gdb-speedbar-update))
764 766
765 (defun gdb-var-list-children (varnum) 767 (defun gdb-var-list-children (varnum)
766 (gdb-enqueue-input 768 (gdb-enqueue-input
767 (list (concat "server interpreter mi \"-var-list-children " varnum "\"\n") 769 (list (concat "server interpreter mi \"-var-list-children " varnum "\"\n")
789 (throw 'child-already-watched nil)) 791 (throw 'child-already-watched nil))
790 (push varchild var-list) 792 (push varchild var-list)
791 (gdb-enqueue-input 793 (gdb-enqueue-input
792 (list 794 (list
793 (concat 795 (concat
794 "server interpreter mi \"-var-evaluate-expression " 796 "server interpreter mi \"0-var-evaluate-expression "
795 (car varchild) "\"\n") 797 (car varchild) "\"\n")
796 `(lambda () (gdb-var-evaluate-expression-handler 798 `(lambda () (gdb-var-evaluate-expression-handler
797 ,(car varchild) nil))))))) 799 ,(car varchild) nil)))))))
798 (push var var-list))) 800 (push var var-list)))
799 (setq gdb-var-list (nreverse var-list))))) 801 (setq gdb-var-list (nreverse var-list)))))
811 813
812 (defun gdb-var-update-handler () 814 (defun gdb-var-update-handler ()
813 (dolist (var gdb-var-list) 815 (dolist (var gdb-var-list)
814 (setcar (nthcdr 5 var) nil)) 816 (setcar (nthcdr 5 var) nil))
815 (goto-char (point-min)) 817 (goto-char (point-min))
816 (while (re-search-forward gdb-var-update-regexp nil t) 818 (let ((n 0))
817 (let ((varnum (match-string 1))) 819 (while (re-search-forward gdb-var-update-regexp nil t)
818 (if (string-equal (match-string 2) "false") 820 (let ((varnum (match-string 1)))
819 (let ((var (assoc varnum gdb-var-list))) 821 (if (string-equal (match-string 2) "false")
820 (if var (setcar (nthcdr 5 var) 'out-of-scope))) 822 (let ((var (assoc varnum gdb-var-list)))
821 (gdb-enqueue-input 823 (if var (setcar (nthcdr 5 var) 'out-of-scope)))
822 (list 824 (setq n (1+ n))
823 (concat "server interpreter mi \"-var-evaluate-expression " 825 (push n gdb-pending-triggers)
824 varnum "\"\n") 826 (gdb-enqueue-input
825 `(lambda () (gdb-var-evaluate-expression-handler ,varnum t))))))) 827 (list
828 (concat "server interpreter mi \"" (number-to-string n)
829 "-var-evaluate-expression " varnum "\"\n")
830 `(lambda () (gdb-var-evaluate-expression-handler ,varnum t))))))))
826 (setq gdb-pending-triggers 831 (setq gdb-pending-triggers
827 (delq 'gdb-var-update gdb-pending-triggers))) 832 (delq 'gdb-var-update gdb-pending-triggers)))
828 833
829 (defun gdb-var-delete () 834 (defun gdb-var-delete ()
830 "Delete watch expression at point from the speedbar." 835 "Delete watch expression at point from the speedbar."
831 (interactive) 836 (interactive)
832 (if (memq (buffer-local-value 'gud-minor-mode gud-comint-buffer) 837 (if (memq (buffer-local-value 'gud-minor-mode gud-comint-buffer)
833 '(gdbmi gdba)) 838 '(gdbmi gdba))
834 (let ((text (speedbar-line-text))) 839 (let ((text (speedbar-line-text)))
835 (string-match "\\(\\S-+\\)" text) 840 ;; Can't use \\S-+ for whitespace because
841 ;; speedbar has a whacky syntax table.
842 (string-match "\\([^ \t]+\\)" text)
836 (let ((expr (match-string 1 text)) var varnum) 843 (let ((expr (match-string 1 text)) var varnum)
837 (catch 'expr-found 844 (catch 'expr-found
838 (dolist (var1 gdb-var-list) 845 (dolist (var1 gdb-var-list)
839 (when (string-equal expr (nth 1 var1)) 846 (when (string-equal expr (nth 1 var1))
840 (setq var var1) 847 (setq var var1)
2801 (move-marker gdb-overlay-arrow-position nil) 2808 (move-marker gdb-overlay-arrow-position nil)
2802 (setq gdb-overlay-arrow-position nil)) 2809 (setq gdb-overlay-arrow-position nil))
2803 (setq overlay-arrow-variable-list 2810 (setq overlay-arrow-variable-list
2804 (delq 'gdb-overlay-arrow-position overlay-arrow-variable-list)) 2811 (delq 'gdb-overlay-arrow-position overlay-arrow-variable-list))
2805 (setq fringe-indicator-alist '((overlay-arrow . right-triangle))) 2812 (setq fringe-indicator-alist '((overlay-arrow . right-triangle)))
2813 (if (boundp 'speedbar-frame) (speedbar-timer-fn))
2806 (setq gud-running nil) 2814 (setq gud-running nil)
2807 (setq gdb-active-process nil) 2815 (setq gdb-active-process nil)
2808 (setq gdb-var-list nil) 2816 (setq gdb-var-list nil)
2809 (remove-hook 'after-save-hook 'gdb-create-define-alist t)) 2817 (remove-hook 'after-save-hook 'gdb-create-define-alist t))
2810 2818