changeset 75554:26b46f8828ba

(gdb-var-delete-1): New function. (gdb-var-delete): Use it. (gdb-var-update-handler-1): Handle value "invalid" for MI field `in_scope'.
author Nick Roberts <nickrob@snap.net.nz>
date Tue, 30 Jan 2007 22:07:12 +0000
parents 2a21a7f5e91c
children d276dce1561f
files lisp/progmodes/gdb-ui.el
diffstat 1 files changed, 16 insertions(+), 21 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/progmodes/gdb-ui.el	Tue Jan 30 22:06:26 2007 +0000
+++ b/lisp/progmodes/gdb-ui.el	Tue Jan 30 22:07:12 2007 +0000
@@ -848,6 +848,19 @@
   (setq gdb-pending-triggers
 	(delq 'gdb-var-update gdb-pending-triggers)))
 
+(defun gdb-var-delete-1 (varnum)
+  (gdb-enqueue-input
+   (list
+    (if (eq (buffer-local-value 'gud-minor-mode gud-comint-buffer)
+	    'gdba)
+	(concat "server interpreter mi \"-var-delete " varnum "\"\n")
+      (concat "-var-delete " varnum "\n"))
+    'ignore))
+  (setq gdb-var-list (delq var gdb-var-list))
+  (dolist (varchild gdb-var-list)
+    (if (string-match (concat (car var) "\\.") (car varchild))
+	(setq gdb-var-list (delq varchild gdb-var-list)))))
+
 (defun gdb-var-delete ()
   "Delete watch expression at point from the speedbar."
   (interactive)
@@ -857,17 +870,7 @@
 	     (varnum (car var)))
 	(if (string-match "\\." (car var))
 	    (message-box "Can only delete a root expression")
-	  (gdb-enqueue-input
-	   (list
-	    (if (eq (buffer-local-value 'gud-minor-mode gud-comint-buffer)
-		    'gdba)
-		(concat "server interpreter mi \"-var-delete " varnum "\"\n")
-	      (concat "-var-delete " varnum "\n"))
-	    'ignore))
-	  (setq gdb-var-list (delq var gdb-var-list))
-	  (dolist (varchild gdb-var-list)
-	    (if (string-match (concat (car var) "\\.") (car varchild))
-		(setq gdb-var-list (delq varchild gdb-var-list))))))))
+	  (gdb-var-delete-1 varnum)))))
 
 (defun gdb-var-delete-children (varnum)
   "Delete children of variable object at point from the speedbar."
@@ -3443,16 +3446,8 @@
 		 (setcar (nthcdr 5 var) 'changed)
 		 (setcar (nthcdr 4 var)
 			 (read (match-string 2))))
-;;		((string-equal match "invalid")
-;;		 (gdb-enqueue-input
-;;		  (list
-;;		   (if (eq (buffer-local-value
-;;			    'gud-minor-mode gud-comint-buffer) 'gdba)
-;;		       (concat "server interpreter mi \"-var-delete "
-;;			       varnum "\"\n")
-;;		     (concat "-var-delete " varnum "\n"))
-;;		   'ignore)))
-		)))))
+		((string-equal match "invalid")
+		 (gdb-var-delete-1 varnum)))))))
       (setq gdb-pending-triggers
 	    (delq 'gdb-var-update gdb-pending-triggers))
       (gdb-speedbar-update))