# HG changeset patch # User Nick Roberts # Date 1201730861 0 # Node ID c88c86182e91cd3393df662035af6ba11dd69d05 # Parent 6640123ea58e4fd1c746ba5e3f216aa94471a0de (gdb-var-set-format-regexp): New constant. (gdb-var-set-format-handler): New function. (gdb-var-set-format): Use it. diff -r 6640123ea58e -r c88c86182e91 lisp/progmodes/gdb-ui.el --- 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