changeset 79667:87eecf56e2a6

(gdb-var-set-format): Set the output format of watch expressions (only works fully with GDB 6.7 or later).
author Nick Roberts <nickrob@snap.net.nz>
date Thu, 03 Jan 2008 21:58:33 +0000
parents efd685c6e675
children 5a1bd3d071b6
files lisp/progmodes/gdb-ui.el
diffstat 1 files changed, 14 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/progmodes/gdb-ui.el	Thu Jan 03 21:54:27 2008 +0000
+++ b/lisp/progmodes/gdb-ui.el	Thu Jan 03 21:58:33 2008 +0000
@@ -881,11 +881,23 @@
   (setq gdb-pending-triggers
 	(delq 'gdb-var-update gdb-pending-triggers)))
 
+(defun gdb-var-set-format (format)
+  "Set the output format for a variable displayed in the speedbar."
+  (let* ((var (nth (- (count-lines (point-min) (point)) 2) gdb-var-list))
+	 (varnum (car var)))
+    (gdb-enqueue-input
+     (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)))
+
 (defun gdb-var-delete-1 (varnum)
   (gdb-enqueue-input
    (list
-    (if (eq (buffer-local-value 'gud-minor-mode gud-comint-buffer)
-	    'gdba)
+    (if (eq (buffer-local-value 'gud-minor-mode gud-comint-buffer) 'gdba)
 	(concat "server interpreter mi \"-var-delete " varnum "\"\n")
       (concat "-var-delete " varnum "\n"))
     'ignore))