changeset 79261:9963a1e6e29f

(gdb-delete-out-of-scope): New option. (gdb-var-update-handler-1): Use it.
author Nick Roberts <nickrob@snap.net.nz>
date Tue, 30 Oct 2007 05:37:34 +0000
parents 379c739aa3c5
children 452dee639463
files lisp/progmodes/gdb-ui.el
diffstat 1 files changed, 9 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/progmodes/gdb-ui.el	Tue Oct 30 05:35:54 2007 +0000
+++ b/lisp/progmodes/gdb-ui.el	Tue Oct 30 05:37:34 2007 +0000
@@ -947,6 +947,12 @@
   :group 'gud
   :version "22.1")
 
+(defcustom gdb-delete-out-of-scope t
+  "If non-nil delete watch expressions automatically when they go out of scope."
+  :type 'boolean
+  :group 'gud
+  :version "22.2")
+
 (defun gdb-speedbar-expand-node (text token indent)
   "Expand the node the user clicked on.
 TEXT is the text of the button we clicked on, a + or - item.
@@ -3515,7 +3521,9 @@
       (when var
 	(let ((match (match-string 3)))
 	  (cond ((string-equal match "false")
-		 (setcar (nthcdr 5 var) 'out-of-scope))
+		 (if gdb-delete-out-of-scope
+		     (gdb-var-delete-1 varnum)
+		   (setcar (nthcdr 5 var) 'out-of-scope)))
 		((string-equal match "true")
 		 (setcar (nthcdr 5 var) 'changed)
 		 (setcar (nthcdr 4 var)