diff 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
line wrap: on
line diff
--- a/lisp/progmodes/gdb-ui.el	Wed May 10 15:04:01 2006 +0000
+++ b/lisp/progmodes/gdb-ui.el	Wed May 17 18:05:02 2006 +0000
@@ -732,9 +732,9 @@
 	(gdb-enqueue-input
 	 (list
 	  (if (eq (buffer-local-value 'gud-minor-mode gud-comint-buffer) 'gdba)
-	      (concat "server interpreter mi \"-var-evaluate-expression "
+	      (concat "server interpreter mi \"0-var-evaluate-expression "
 		      (car var) "\"\n")
-	    (concat "-var-evaluate-expression " (car var) "\n"))
+	    (concat "0-var-evaluate-expression " (car var) "\n"))
 	  `(lambda () (gdb-var-evaluate-expression-handler
 		       ,(car var) nil)))))
     (if (search-forward "Undefined command" nil t)
@@ -755,11 +755,13 @@
 
 (defun gdb-var-evaluate-expression-handler (varnum changed)
   (goto-char (point-min))
-  (re-search-forward ".*value=\\(\".*\"\\)" nil t)
+  (re-search-forward "\\(.+\\)\\^done,value=\\(\".*\"\\)" nil t)
+  (setq gdb-pending-triggers
+	(delq (string-to-number (match-string 1)) gdb-pending-triggers))
   (let ((var (assoc varnum gdb-var-list)))
     (when var
       (if changed (setcar (nthcdr 5 var) 'changed))
-      (setcar (nthcdr 4 var) (read (match-string 1)))))
+      (setcar (nthcdr 4 var) (read (match-string 2)))))
   (gdb-speedbar-update))
 
 (defun gdb-var-list-children (varnum)
@@ -791,7 +793,7 @@
 		  (gdb-enqueue-input
 		   (list
 		    (concat
-		     "server interpreter mi \"-var-evaluate-expression "
+		     "server interpreter mi \"0-var-evaluate-expression "
 		     (car varchild) "\"\n")
 		    `(lambda () (gdb-var-evaluate-expression-handler
 				 ,(car varchild) nil)))))))
@@ -813,16 +815,19 @@
   (dolist (var gdb-var-list)
     (setcar (nthcdr 5 var) nil))
   (goto-char (point-min))
-  (while (re-search-forward gdb-var-update-regexp nil t)
-    (let ((varnum (match-string 1)))
-      (if  (string-equal (match-string 2) "false")
-	  (let ((var (assoc varnum gdb-var-list)))
-	    (if var (setcar (nthcdr 5 var) 'out-of-scope)))
-	(gdb-enqueue-input
-	 (list
-	  (concat "server interpreter mi \"-var-evaluate-expression "
-		  varnum "\"\n")
-	  `(lambda () (gdb-var-evaluate-expression-handler ,varnum t)))))))
+  (let ((n 0))
+    (while (re-search-forward gdb-var-update-regexp nil t)
+      (let ((varnum (match-string 1)))
+	(if  (string-equal (match-string 2) "false")
+	    (let ((var (assoc varnum gdb-var-list)))
+	      (if var (setcar (nthcdr 5 var) 'out-of-scope)))
+	  (setq n (1+ n))
+	  (push n gdb-pending-triggers)
+	  (gdb-enqueue-input
+	   (list
+	    (concat "server interpreter mi \"" (number-to-string n)
+		    "-var-evaluate-expression " varnum "\"\n")
+	  `(lambda () (gdb-var-evaluate-expression-handler ,varnum t))))))))
   (setq gdb-pending-triggers
 	(delq 'gdb-var-update gdb-pending-triggers)))
 
@@ -832,7 +837,9 @@
   (if (memq (buffer-local-value 'gud-minor-mode gud-comint-buffer)
 	    '(gdbmi gdba))
       (let ((text (speedbar-line-text)))
-	(string-match "\\(\\S-+\\)" text)
+	;; Can't use \\S-+ for whitespace because
+	;; speedbar has a whacky syntax table.
+	(string-match "\\([^ \t]+\\)" text)
 	(let ((expr (match-string 1 text)) var varnum)
 	  (catch 'expr-found
 	    (dolist (var1 gdb-var-list)
@@ -2803,6 +2810,7 @@
   (setq overlay-arrow-variable-list
 	(delq 'gdb-overlay-arrow-position overlay-arrow-variable-list))
   (setq fringe-indicator-alist '((overlay-arrow . right-triangle)))
+  (if (boundp 'speedbar-frame) (speedbar-timer-fn))
   (setq gud-running nil)
   (setq gdb-active-process nil)
   (setq gdb-var-list nil)