aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNick Roberts2006-12-04 03:26:44 +0000
committerNick Roberts2006-12-04 03:26:44 +0000
commit9106c6aebebf35e956b77f96dead69db92e6a60b (patch)
tree3f15aec8c24410b5ffdcc3f871ec934c418a12bb
parentd2e126dc74728efb8825236cf19e49f47a0cb538 (diff)
downloademacs-9106c6aebebf35e956b77f96dead69db92e6a60b.tar.gz
emacs-9106c6aebebf35e956b77f96dead69db92e6a60b.zip
(gdb-var-delete-children): New function.
(gdb-speedbar-expand-node): Use it.
-rw-r--r--lisp/progmodes/gdb-ui.el21
1 files changed, 16 insertions, 5 deletions
diff --git a/lisp/progmodes/gdb-ui.el b/lisp/progmodes/gdb-ui.el
index 225952366dd..48dd31b19f9 100644
--- a/lisp/progmodes/gdb-ui.el
+++ b/lisp/progmodes/gdb-ui.el
@@ -40,8 +40,8 @@
40;; This file has evolved from gdba.el that was included with GDB 5.0 and 40;; This file has evolved from gdba.el that was included with GDB 5.0 and
41;; written by Tom Lord and Jim Kingdon. It uses GDB's annotation interface. 41;; written by Tom Lord and Jim Kingdon. It uses GDB's annotation interface.
42;; You don't need to know about annotations to use this mode as a debugger, 42;; You don't need to know about annotations to use this mode as a debugger,
43;; but if you are interested developing the mode itself, then see the 43;; but if you are interested developing the mode itself, see the Annotations
44;; Annotations section in the GDB info manual. 44;; section in the GDB info manual.
45 45
46;; GDB developers plan to make the annotation interface obsolete. A new 46;; GDB developers plan to make the annotation interface obsolete. A new
47;; interface called GDB/MI (machine interface) has been designed to replace 47;; interface called GDB/MI (machine interface) has been designed to replace
@@ -51,9 +51,9 @@
51;; still under development and is part of a process to migrate Emacs from 51;; still under development and is part of a process to migrate Emacs from
52;; annotations to GDB/MI. 52;; annotations to GDB/MI.
53 53
54;; This mode SHOULD WORK WITH GDB 5.0 onwards but you will NEED GDB 6.0 54;; This mode SHOULD WORK WITH GDB 5.0 or later but you will NEED AT LEAST
55;; onwards to use watch expressions. It works best with GDB 6.4 where 55;; GDB 6.0 to use watch expressions. It works best with GDB 6.4 or later
56;; watch expressions will update more quickly. 56;; where watch expressions will update more quickly.
57 57
58;;; Windows Platforms: 58;;; Windows Platforms:
59 59
@@ -81,12 +81,14 @@
81;; "gdb --annotate=2 myprog" to keep source buffer/selected frame fixed. 81;; "gdb --annotate=2 myprog" to keep source buffer/selected frame fixed.
82 82
83;;; Problems with watch expressions, GDB/MI: 83;;; Problems with watch expressions, GDB/MI:
84
84;; 1) They go out of scope when the inferior is re-run. 85;; 1) They go out of scope when the inferior is re-run.
85;; 2) -stack-list-locals has a type field but also prints type in values field. 86;; 2) -stack-list-locals has a type field but also prints type in values field.
86;; 3) VARNUM increments even when variable object is not created 87;; 3) VARNUM increments even when variable object is not created
87;; (maybe trivial). 88;; (maybe trivial).
88 89
89;;; TODO: 90;;; TODO:
91
90;; 1) Use MI command -data-read-memory for memory window. 92;; 1) Use MI command -data-read-memory for memory window.
91;; 2) Use tree-widget.el instead of the speedbar for watch-expressions? 93;; 2) Use tree-widget.el instead of the speedbar for watch-expressions?
92;; 3) Mark breakpoint locations on scroll-bar of source buffer? 94;; 3) Mark breakpoint locations on scroll-bar of source buffer?
@@ -871,6 +873,14 @@ type_changed=\".*?\".*?}")
871 (if (string-match (concat (car var) "\\.") (car varchild)) 873 (if (string-match (concat (car var) "\\.") (car varchild))
872 (setq gdb-var-list (delq varchild gdb-var-list))))))))) 874 (setq gdb-var-list (delq varchild gdb-var-list)))))))))
873 875
876(defun gdb-var-delete-children (varnum)
877 "Delete children of variable object point from the speedbar."
878 (gdb-enqueue-input
879 (list
880 (if (eq (buffer-local-value 'gud-minor-mode gud-comint-buffer) 'gdba)
881 (concat "server interpreter mi \"-var-delete -c " varnum "\"\n")
882 (concat "-var-delete -c " varnum "\n")) 'ignore)))
883
874(defun gdb-edit-value (text token indent) 884(defun gdb-edit-value (text token indent)
875 "Assign a value to a variable displayed in the speedbar." 885 "Assign a value to a variable displayed in the speedbar."
876 (let* ((var (nth (- (count-lines (point-min) (point)) 2) gdb-var-list)) 886 (let* ((var (nth (- (count-lines (point-min) (point)) 2) gdb-var-list))
@@ -914,6 +924,7 @@ INDENT is the current indentation depth."
914 (dolist (var gdb-var-list) 924 (dolist (var gdb-var-list)
915 (if (string-match (concat token "\\.") (car var)) 925 (if (string-match (concat token "\\.") (car var))
916 (setq gdb-var-list (delq var gdb-var-list)))) 926 (setq gdb-var-list (delq var gdb-var-list))))
927 (gdb-var-delete-children token)
917 (speedbar-change-expand-button-char ?+) 928 (speedbar-change-expand-button-char ?+)
918 (speedbar-delete-subblock indent)) 929 (speedbar-delete-subblock indent))
919 (t (error "Ooops... not sure what to do"))) 930 (t (error "Ooops... not sure what to do")))