changeset 79965:c88c86182e91 EMACS_PRETEST_22_1_90

(gdb-var-set-format-regexp): New constant. (gdb-var-set-format-handler): New function. (gdb-var-set-format): Use it.
author Nick Roberts <nickrob@snap.net.nz>
date Wed, 30 Jan 2008 22:07:41 +0000
parents 6640123ea58e
children 6c914e475446
files lisp/progmodes/gdb-ui.el
diffstat 1 files changed, 12 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/progmodes/gdb-ui.el	Wed Jan 30 22:06:11 2008 +0000
+++ b/lisp/progmodes/gdb-ui.el	Wed Jan 30 22:07:41 2008 +0000
@@ -886,13 +886,22 @@
   (let* ((var (nth (- (count-lines (point-min) (point)) 2) gdb-var-list))
 	 (varnum (car var)))
     (gdb-enqueue-input
-     (list 
+     (list
       (if (eq (buffer-local-value 'gud-minor-mode gud-comint-buffer) 'gdba)
 	  (concat "server interpreter mi \"-var-set-format "
 		  varnum " " format "\"\n")
 	(concat "-var-set-format " varnum " " format "\n"))
-      'ignore))
-    (gdb-var-update-1)))
+	   `(lambda () (gdb-var-set-format-handler ,varnum))))))
+
+(defconst gdb-var-set-format-regexp
+  "format=\"\\(.*?\\)\",.*value=\"\\(.*?\\)\"")
+
+(defun gdb-var-set-format-handler (varnum)
+  (goto-char (point-min))
+  (if (re-search-forward gdb-var-set-format-regexp nil t)
+      (let ((var (assoc varnum gdb-var-list)))
+	(setcar (nthcdr 4 var) (match-string 2))
+	(gdb-var-update-1))))
 
 (defun gdb-var-delete-1 (varnum)
   (gdb-enqueue-input