emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] Changes to emacs/lisp/progmodes/gdb-ui.el,v


From: Nick Roberts
Subject: [Emacs-diffs] Changes to emacs/lisp/progmodes/gdb-ui.el,v
Date: Thu, 17 Aug 2006 11:44:41 +0000

CVSROOT:        /sources/emacs
Module name:    emacs
Changes by:     Nick Roberts <nickrob>  06/08/17 11:44:41

Index: gdb-ui.el
===================================================================
RCS file: /sources/emacs/emacs/lisp/progmodes/gdb-ui.el,v
retrieving revision 1.181
retrieving revision 1.182
diff -u -b -r1.181 -r1.182
--- gdb-ui.el   15 Aug 2006 00:01:16 -0000      1.181
+++ gdb-ui.el   17 Aug 2006 11:44:40 -0000      1.182
@@ -384,8 +384,7 @@
                            (list t nil) nil "-c"
                            (concat gdb-cpp-define-alist-program " "
                                    gdb-cpp-define-alist-flags)))))
-       (define-list (split-string output "\n" t))
-       (name))
+       (define-list (split-string output "\n" t)) (name))
     (setq gdb-define-alist nil)
     (dolist (define define-list)
       (setq name (nth 1 (split-string define "[( ]")))
@@ -2657,6 +2656,7 @@
 
 (defvar gdb-locals-watch-map
   (let ((map (make-sparse-keymap)))
+    (suppress-keymap map)
     (define-key map "\r" (lambda () (interactive)
                           (beginning-of-line)
                           (gud-watch)))
@@ -3512,10 +3512,32 @@
 
 (defvar gdb-locals-watch-map-1
   (let ((map (make-sparse-keymap)))
+    (suppress-keymap map)
+    (define-key map "\r" 'gud-watch)
     (define-key map [mouse-2] 'gud-watch)
     map)
  "Keymap to create watch expression of a complex data type local variable.")
 
+(defvar gdb-edit-locals-map-1
+  (let ((map (make-sparse-keymap)))
+    (suppress-keymap map)
+    (define-key map "\r" 'gdb-edit-locals-value)
+    (define-key map [mouse-2] 'gdb-edit-locals-value)
+    map)
+ "Keymap to edit value of a simple data type local variable.")
+
+(defun gdb-edit-locals-value (&optional event)
+  "Assign a value to a variable displayed in the locals buffer."
+  (interactive (list last-input-event))
+  (save-excursion
+    (if event (posn-set-point (event-end event)))
+    (beginning-of-line)
+    (let* ((var (current-word))
+          (value (read-string (format "New value (%s): " var))))
+      (gdb-enqueue-input
+       (list (concat  gdb-server-prefix"set variable " var " = " value "\n")
+            'ignore))))))
+
 ;; Dont display values of arrays or structures.
 ;; These can be expanded using gud-watch.
 (defun gdb-stack-list-locals-handler ()
@@ -3543,17 +3565,23 @@
                   (let* ((window (get-buffer-window buf 0))
                          (start (window-start window))
                          (p (window-point window))
-                         (buffer-read-only nil))
+                         (buffer-read-only nil) (name) (value))
                     (erase-buffer)
                     (dolist (local locals-list)
                       (setq name (car local))
-                      (if (or (not (nth 2 local))
-                              (string-match "^\\0x" (nth 2 local)))
+                      (setq value (nth 2 local))
+                      (if (or (not value)
+                              (string-match "^\\0x" value))
                           (add-text-properties 0 (length name)
                                `(mouse-face highlight
                                  help-echo "mouse-2: create watch expression"
                                  local-map ,gdb-locals-watch-map-1)
-                               name))
+                               name)
+                        (add-text-properties 0 (length value)
+                             `(mouse-face highlight
+                               help-echo "mouse-2: edit value"
+                               local-map ,gdb-edit-locals-map-1)
+                             value))
                       (insert
                        (concat name "\t" (nth 1 local)
                                "\t" (nth 2 local) "\n")))




reply via email to

[Prev in Thread] Current Thread [Next in Thread]