changeset 67891:c6d86f53dcf3

(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.
author Nick Roberts <nickrob@snap.net.nz>
date Thu, 29 Dec 2005 02:04:36 +0000
parents a6271fd07ee3
children e188efbb47ee ec395f552d45
files lisp/progmodes/gdb-ui.el
diffstat 1 files changed, 10 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- 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)