Commit 39043abb authored by Nick Roberts's avatar Nick Roberts
Browse files

(gdb-var-update, gdb-var-update-handler, gdb-var-delete)

(gdb-edit-value, gdb-speedbar-expand-node): Handle new value for
gud-minor-mode (gdbmi).
parent c9858347
...@@ -319,7 +319,11 @@ speedbar." ...@@ -319,7 +319,11 @@ speedbar."
(defun gdb-var-update () (defun gdb-var-update ()
(if (not (member 'gdb-var-update gdb-pending-triggers)) (if (not (member 'gdb-var-update gdb-pending-triggers))
(progn (progn
(gdb-enqueue-input (list "server interpreter mi \"-var-update *\"\n" (gdb-enqueue-input
(list
(if (with-current-buffer gud-comint-buffer (eq gud-minor-mode 'gdba))
"server interpreter mi \"-var-update *\"\n"
"-var-update *\n")
'gdb-var-update-handler)) 'gdb-var-update-handler))
(push 'gdb-var-update gdb-pending-triggers)))) (push 'gdb-var-update gdb-pending-triggers))))
...@@ -331,8 +335,11 @@ speedbar." ...@@ -331,8 +335,11 @@ speedbar."
(while (re-search-forward gdb-var-update-regexp nil t) (while (re-search-forward gdb-var-update-regexp nil t)
(let ((varnum (match-string 1))) (let ((varnum (match-string 1)))
(gdb-enqueue-input (gdb-enqueue-input
(list (concat "server interpreter mi \"-var-evaluate-expression " (list
(if (with-current-buffer gud-comint-buffer (eq gud-minor-mode 'gdba))
(concat "server interpreter mi \"-var-evaluate-expression "
varnum "\"\n") varnum "\"\n")
(concat "-var-evaluate-expression " varnum "\n"))
`(lambda () (gdb-var-evaluate-expression-handler `(lambda () (gdb-var-evaluate-expression-handler
,varnum t))))))) ,varnum t)))))))
(setq gdb-pending-triggers (setq gdb-pending-triggers
...@@ -349,8 +356,11 @@ speedbar." ...@@ -349,8 +356,11 @@ speedbar."
(varnum (cadr var))) (varnum (cadr var)))
(unless (string-match "\\." varnum) (unless (string-match "\\." varnum)
(gdb-enqueue-input (gdb-enqueue-input
(list (concat "server interpreter mi \"-var-delete " (list
varnum "\"\n") (if (with-current-buffer gud-comint-buffer
(eq gud-minor-mode 'gdba))
(concat "server interpreter mi \"-var-delete " varnum "\"\n")
(concat "-var-delete " varnum "\n"))
'ignore)) 'ignore))
(setq gdb-var-list (delq var gdb-var-list)) (setq gdb-var-list (delq var gdb-var-list))
(dolist (varchild gdb-var-list) (dolist (varchild gdb-var-list)
...@@ -364,8 +374,11 @@ speedbar." ...@@ -364,8 +374,11 @@ speedbar."
(varnum (cadr var)) (value)) (varnum (cadr var)) (value))
(setq value (read-string "New value: ")) (setq value (read-string "New value: "))
(gdb-enqueue-input (gdb-enqueue-input
(list (concat "server interpreter mi \"-var-assign " (list
varnum " " value "\"\n") (if (with-current-buffer gud-comint-buffer
(eq gud-minor-mode 'gdba))
(concat "server interpreter mi \"-var-assign " varnum " " value "\"\n")
(concat "-var-assign " varnum " " value "\n"))
'ignore)))) 'ignore))))
(defcustom gdb-show-changed-values t (defcustom gdb-show-changed-values t
...@@ -380,7 +393,9 @@ TEXT is the text of the button we clicked on, a + or - item. ...@@ -380,7 +393,9 @@ TEXT is the text of the button we clicked on, a + or - item.
TOKEN is data related to this node. TOKEN is data related to this node.
INDENT is the current indentation depth." INDENT is the current indentation depth."
(cond ((string-match "+" text) ;expand this node (cond ((string-match "+" text) ;expand this node
(gdb-var-list-children token)) (if (with-current-buffer gud-comint-buffer (eq gud-minor-mode 'gdba))
(gdb-var-list-children token)
(gdbmi-var-list-children token)))
((string-match "-" text) ;contract this node ((string-match "-" text) ;contract this node
(dolist (var gdb-var-list) (dolist (var gdb-var-list)
(if (string-match (concat token "\\.") (nth 1 var)) (if (string-match (concat token "\\.") (nth 1 var))
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment