# HG changeset patch # User Nick Roberts # Date 1108789729 0 # Node ID 10993bad7aeea4be6cd4fef753852b4171e6e74e # Parent 9034298c06c15caa77c5fb346a0a9e156a481c0d (gdb-var-update-handler) (gdb-speedbar-timer-fn): Ensure speedbar updates with new values for watch expressions, (gdb-var-create-handler): Don't set speedbar-update-flag. (gdb-post-prompt): Simplify test for speedbar. diff -r 9034298c06c1 -r 10993bad7aee lisp/progmodes/gdb-ui.el --- a/lisp/progmodes/gdb-ui.el Sat Feb 19 05:06:30 2005 +0000 +++ b/lisp/progmodes/gdb-ui.el Sat Feb 19 05:08:49 2005 +0000 @@ -338,7 +338,6 @@ (match-string 3) nil nil))) (push var gdb-var-list) - (setq speedbar-update-flag t) (speedbar 1) (if (equal (nth 2 var) "0") (gdb-enqueue-input @@ -433,7 +432,18 @@ `(lambda () (gdb-var-evaluate-expression-handler ,varnum t))))))) (setq gdb-pending-triggers - (delq 'gdb-var-update gdb-pending-triggers))) + (delq 'gdb-var-update gdb-pending-triggers)) + (when (and (boundp 'speedbar-frame) (frame-live-p speedbar-frame)) + ;; dummy command to update speedbar at right time + (gdb-enqueue-input (list "server pwd\n" 'gdb-speedbar-timer-fn)) + ;; keep gdb-pending-triggers non-nil till end + (push 'gdb-speedbar-timer gdb-pending-triggers))) + +(defun gdb-speedbar-timer-fn () + (setq gdb-pending-triggers + (delq 'gdb-speedbar-timer gdb-pending-triggers)) + (with-current-buffer gud-comint-buffer + (speedbar-timer-fn))) (defun gdb-var-delete () "Delete watched expression from the speedbar." @@ -882,12 +892,12 @@ (gdb-invalidate-threads) (unless (eq system-type 'darwin) ;Breaks on Darwin's GDB-5.3. ;; FIXME: with GDB-6 on Darwin, this might very well work. - (dolist (frame (frame-list)) - (when (string-equal (frame-parameter frame 'name) "Speedbar") - (setq gdb-var-changed t) ; force update - (dolist (var gdb-var-list) - (setcar (nthcdr 5 var) nil)))) - (gdb-var-update)))) + ;; only needed/used with speedbar/watch expressions + (when (and (boundp 'speedbar-frame) (frame-live-p speedbar-frame)) + (setq gdb-var-changed t) ; force update + (dolist (var gdb-var-list) + (setcar (nthcdr 5 var) nil)) + (gdb-var-update))))) (let ((sink gdb-output-sink)) (cond ((eq sink 'user) t)