aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNick Roberts2008-04-25 10:59:20 +0000
committerNick Roberts2008-04-25 10:59:20 +0000
commit34fb82b8da0f8b03d1fe1e486cd5db0006e00052 (patch)
treee9e837abe21dbadecc25d0f3ce2c1488c4f8e660
parent7b8ce2d7ca7be016f6a83bd9bb187b76ec87451a (diff)
downloademacs-34fb82b8da0f8b03d1fe1e486cd5db0006e00052.tar.gz
emacs-34fb82b8da0f8b03d1fe1e486cd5db0006e00052.zip
(gud-watch): Don't create speedbar...
(gdb-var-create-handler): ...until here when there are values. (gdb-post-prompt): Don't do -var-update with no watch expressions. (gdb-info-locals-handler): Don't match "struct {...}" as an array.
-rw-r--r--lisp/progmodes/gdb-ui.el24
1 files changed, 13 insertions, 11 deletions
diff --git a/lisp/progmodes/gdb-ui.el b/lisp/progmodes/gdb-ui.el
index dd7c023433e..ccb11a2f7e2 100644
--- a/lisp/progmodes/gdb-ui.el
+++ b/lisp/progmodes/gdb-ui.el
@@ -757,15 +757,14 @@ With arg, enter name of variable to be watched in the minibuffer."
757 (buffer-substring (region-beginning) (region-end)) 757 (buffer-substring (region-beginning) (region-end))
758 (concat (if (eq major-mode 'gdb-registers-mode) "$") 758 (concat (if (eq major-mode 'gdb-registers-mode) "$")
759 (tooltip-identifier-from-point (point))))))) 759 (tooltip-identifier-from-point (point)))))))
760 (speedbar 1) 760 (set-text-properties 0 (length expr) nil expr)
761 (set-text-properties 0 (length expr) nil expr) 761 (gdb-enqueue-input
762 (gdb-enqueue-input 762 (list
763 (list 763 (if (eq minor-mode 'gdba)
764 (if (eq minor-mode 'gdba) 764 (concat
765 (concat 765 "server interpreter mi \"-var-create - * " expr "\"\n")
766 "server interpreter mi \"-var-create - * " expr "\"\n") 766 (concat"-var-create - * " expr "\n"))
767 (concat"-var-create - * " expr "\n")) 767 `(lambda () (gdb-var-create-handler ,expr)))))))
768 `(lambda () (gdb-var-create-handler ,expr)))))))
769 (message "gud-watch is a no-op in this mode.")))) 768 (message "gud-watch is a no-op in this mode."))))
770 769
771(defconst gdb-var-create-regexp 770(defconst gdb-var-create-regexp
@@ -785,6 +784,7 @@ With arg, enter name of variable to be watched in the minibuffer."
785 (if (match-string 3) (read (match-string 3))) 784 (if (match-string 3) (read (match-string 3)))
786 nil gdb-frame-address))) 785 nil gdb-frame-address)))
787 (push var gdb-var-list) 786 (push var gdb-var-list)
787 (speedbar 1)
788 (unless (string-equal 788 (unless (string-equal
789 speedbar-initial-expansion-list-name "GUD") 789 speedbar-initial-expansion-list-name "GUD")
790 (speedbar-change-initial-expansion-list "GUD")) 790 (speedbar-change-initial-expansion-list "GUD"))
@@ -1563,7 +1563,8 @@ happens to be appropriate."
1563 (gdb-invalidate-locals-1)) 1563 (gdb-invalidate-locals-1))
1564 1564
1565 (gdb-invalidate-threads) 1565 (gdb-invalidate-threads)
1566 (unless (eq system-type 'darwin) ;Breaks on Darwin's GDB-5.3. 1566 (unless (or (null gdb-var-list)
1567 (eq system-type 'darwin)) ;Breaks on Darwin's GDB-5.3.
1567 ;; FIXME: with GDB-6 on Darwin, this might very well work. 1568 ;; FIXME: with GDB-6 on Darwin, this might very well work.
1568 ;; Only needed/used with speedbar/watch expressions. 1569 ;; Only needed/used with speedbar/watch expressions.
1569 (when (and (boundp 'speedbar-frame) (frame-live-p speedbar-frame)) 1570 (when (and (boundp 'speedbar-frame) (frame-live-p speedbar-frame))
@@ -2984,13 +2985,14 @@ another GDB command e.g pwd, to see new frames")
2984 (let ((buf (gdb-get-buffer 'gdb-partial-output-buffer))) 2985 (let ((buf (gdb-get-buffer 'gdb-partial-output-buffer)))
2985 (with-current-buffer buf 2986 (with-current-buffer buf
2986 (goto-char (point-min)) 2987 (goto-char (point-min))
2988 ;; Need this in case "set print pretty" is on.
2987 (while (re-search-forward "^[ }].*\n" nil t) 2989 (while (re-search-forward "^[ }].*\n" nil t)
2988 (replace-match "" nil nil)) 2990 (replace-match "" nil nil))
2989 (goto-char (point-min)) 2991 (goto-char (point-min))
2990 (while (re-search-forward "{\\(.*=.*\n\\|\n\\)" nil t) 2992 (while (re-search-forward "{\\(.*=.*\n\\|\n\\)" nil t)
2991 (replace-match gdb-struct-string nil nil)) 2993 (replace-match gdb-struct-string nil nil))
2992 (goto-char (point-min)) 2994 (goto-char (point-min))
2993 (while (re-search-forward "\\s-*{.*\n" nil t) 2995 (while (re-search-forward "\\s-*{[^.].*\n" nil t)
2994 (replace-match gdb-array-string nil nil)))) 2996 (replace-match gdb-array-string nil nil))))
2995 (let ((buf (gdb-get-buffer 'gdb-locals-buffer))) 2997 (let ((buf (gdb-get-buffer 'gdb-locals-buffer)))
2996 (and buf 2998 (and buf