summaryrefslogtreecommitdiff
path: root/lisp/progmodes/gdb-ui.el
diff options
context:
space:
mode:
authorNick Roberts <nickrob@snap.net.nz>2006-02-17 00:25:16 +0000
committerNick Roberts <nickrob@snap.net.nz>2006-02-17 00:25:16 +0000
commitb32d1b9b0198a6e74906eb520e8d65ec836e2fec (patch)
tree1223f53d28e32f25f071aa0c3748da1560c70bf9 /lisp/progmodes/gdb-ui.el
parentcf5a5c38c6d1263cbdcf4561b25f5e6988f4c419 (diff)
downloademacs-b32d1b9b0198a6e74906eb520e8d65ec836e2fec.tar.gz
(gdba, gdb-var-list): Improve doc strings.
(menu): Re-order menu items. (gdb-var-update-regexp, gdb-var-update-regexp-1): Match "in_scope" field. (gdb-var-update-handler-1): Use it for GDB 6.4+. (gdb-post-prompt): Speed things by not forcing update.
Diffstat (limited to 'lisp/progmodes/gdb-ui.el')
-rw-r--r--lisp/progmodes/gdb-ui.el27
1 files changed, 20 insertions, 7 deletions
diff --git a/lisp/progmodes/gdb-ui.el b/lisp/progmodes/gdb-ui.el
index 588583e9f51..2e7fa41d622 100644
--- a/lisp/progmodes/gdb-ui.el
+++ b/lisp/progmodes/gdb-ui.el
@@ -72,8 +72,16 @@
;; 1) Strings that are watched don't update in the speedbar when their
;; contents change.
-;; 2) Watch expressions go out of scope when the inferior is re-run.
-;; 3) Cannot handle multiple debug sessions.
+;; 2) Cannot handle multiple debug sessions.
+
+;;; Problems with watch expressions:
+
+;; 1) They go out of scope when the inferior is re-run.
+;; 2) -var-update reports that an out of scope variable has changed:
+;; changelist=[{name="var1",in_scope="false"}], but the value can't be accessed.
+;; (-var-list-children, in contrast allows you to create variable objects of
+;; the children when they are out of scope and get their values).
+;; 3) VARNUM increments even when vaiable object is not created (maybe trivial).
;;; TODO:
@@ -97,7 +105,9 @@
(defvar gdb-selected-frame nil)
(defvar gdb-frame-number nil)
(defvar gdb-current-language nil)
-(defvar gdb-var-list nil "List of variables in watch window.")
+(defvar gdb-var-list nil
+ "List of variables in watch window.
+Each element has the form (EXPRESSION VARNUM NUMCHILD TYPE VALUE CHANGED-P).")
(defvar gdb-var-changed nil "Non-nil means that `gdb-var-list' has changed.")
(defvar gdb-main-file nil "Source file from which program execution begins.")
(defvar gdb-overlay-arrow-position nil)
@@ -663,7 +673,7 @@ type=\"\\(.*?\\)\"")
'gdb-var-update-handler))
(push 'gdb-var-update gdb-pending-triggers)))
-(defconst gdb-var-update-regexp "name=\"\\(.*?\\)\"")
+(defconst gdb-var-update-regexp "name=\"\\(.*?\\)\",in_scope=\"\\(.*?\\)\"")
(defun gdb-var-update-handler ()
(goto-char (point-min))
@@ -1204,7 +1214,6 @@ happens to be appropriate."
;; FIXME: with GDB-6 on Darwin, this might very well work.
;; Only needed/used with speedbar/watch expressions.
(when (and (boundp 'speedbar-frame) (frame-live-p speedbar-frame))
- (setq gdb-var-changed t) ; force update
(dolist (var gdb-var-list)
(setcar (nthcdr 5 var) nil))
(if (string-equal gdb-version "pre-6.4")
@@ -3028,7 +3037,8 @@ value=\\(\".*?\"\\),type=\"\\(.+?\\)\"}")
'gdb-var-update-handler-1))
(push 'gdb-var-update gdb-pending-triggers))))
-(defconst gdb-var-update-regexp-1 "name=\"\\(.*?\\)\",value=\\(\".*?\"\\),")
+(defconst gdb-var-update-regexp-1
+ "name=\"\\(.*?\\)\",\\(?:value=\\(\".*?\"\\),\\)?in_scope=\"\\(.*?\\)\"")
(defun gdb-var-update-handler-1 ()
(goto-char (point-min))
@@ -3040,7 +3050,10 @@ value=\\(\".*?\"\\),type=\"\\(.+?\\)\"}")
(if (string-equal varnum (cadr var))
(progn
(setcar (nthcdr 5 var) t)
- (setcar (nthcdr 4 var) (read (match-string 2)))
+ (setcar (nthcdr 4 var)
+ (if (string-equal (match-string 3) "true")
+ (read (match-string 2))
+ "*changed*"))
(setcar (nthcdr num gdb-var-list) var)
(throw 'var-found1 nil)))
(setq num (+ num 1))))))