# HG changeset patch # User Nick Roberts # Date 1135821876 0 # Node ID c6d86f53dcf30d98f33ec933084e1aafa0026cf2 # Parent a6271fd07ee36e76a98b4c7bfbf6c664e45701d7 (gdb-tooltip-print, gdb-tooltip-print-1): Display name of expression instead of convenience variable. (gdb-post-prompt): Only call gdb-get-changed-registers if needed. diff -r a6271fd07ee3 -r c6d86f53dcf3 lisp/progmodes/gdb-ui.el --- a/lisp/progmodes/gdb-ui.el Thu Dec 29 02:03:20 2005 +0000 +++ b/lisp/progmodes/gdb-ui.el Thu Dec 29 02:04:36 2005 +0000 @@ -331,10 +331,14 @@ (setq name (nth 1 (split-string define "[( ]"))) (push (cons name define) gdb-define-alist)))) -(defun gdb-tooltip-print () +(defun gdb-tooltip-print (expr) (tooltip-show (with-current-buffer (gdb-get-buffer 'gdb-partial-output-buffer) - (let ((string (buffer-string))) + (goto-char (point-min)) + (let ((string + (if (search-forward "=" nil t) + (concat expr (buffer-substring (- (point) 2) (point-max))) + (buffer-string)))) ;; remove newline for gud-tooltip-echo-area (substring string 0 (- (length string) 1)))) (or gud-tooltip-echo-area tooltip-use-echo-area))) @@ -349,7 +353,7 @@ (unless (looking-at "\\S-+.*(.*).*") (gdb-enqueue-input (list (concat gdb-server-prefix "print " expr "\n") - 'gdb-tooltip-print)))))) + `(lambda () (gdb-tooltip-print ,expr)))))))) (defconst gdb-source-file-regexp "\\(.+?\\), \\|\\([^, \n].*$\\)") @@ -541,7 +545,8 @@ :version "22.1") (defun gdb-speedbar-auto-raise (arg) - "Toggle automatic raising of the speedbar for watch expressions." + "Toggle automatic raising of the speedbar for watch expressions. +With arg, automatically raise speedbar iff arg is positive." (interactive "P") (setq gdb-speedbar-auto-raise (if (null arg) @@ -1194,7 +1199,7 @@ (if (string-equal gdb-version "pre-6.4") (gdb-invalidate-registers) - (gdb-get-changed-registers) + (if (gdb-get-buffer 'gdb-registers-buffer) (gdb-get-changed-registers)) (gdb-invalidate-registers-1)) (gdb-invalidate-memory)