summaryrefslogtreecommitdiff
path: root/lisp/progmodes/gdb-ui.el
diff options
context:
space:
mode:
authorNick Roberts <nickrob@snap.net.nz>2005-11-13 09:02:23 +0000
committerNick Roberts <nickrob@snap.net.nz>2005-11-13 09:02:23 +0000
commit9e772f982cce813da1275dae9120d4e003b69ec1 (patch)
tree6b83f5f9e34757329be64b269dd74f55a578a0ec /lisp/progmodes/gdb-ui.el
parent9ecc27d05e147e4612a24b968f03951132bdf76c (diff)
downloademacs-9e772f982cce813da1275dae9120d4e003b69ec1.tar.gz
(gdb-var-create-handler, gdb-var-list-children-handler):
Match on "const char *" too. (gdb-var-evaluate-expression-handler): Match on empty string. (gdb-var-update-handler): Only call gdb-var-evaluate-expression-handler when required.
Diffstat (limited to 'lisp/progmodes/gdb-ui.el')
-rw-r--r--lisp/progmodes/gdb-ui.el23
1 files changed, 15 insertions, 8 deletions
diff --git a/lisp/progmodes/gdb-ui.el b/lisp/progmodes/gdb-ui.el
index dfd32256d3c..0d3d29205ae 100644
--- a/lisp/progmodes/gdb-ui.el
+++ b/lisp/progmodes/gdb-ui.el
@@ -493,7 +493,7 @@ With arg, use separate IO iff arg is positive."
(speedbar-change-initial-expansion-list "GUD"))
(if (or (equal (nth 2 var) "0")
(and (equal (nth 2 var) "1")
- (equal (nth 3 var) "char *")))
+ (string-match "char \\*" (nth 3 var))))
(gdb-enqueue-input
(list
(if (eq (buffer-local-value 'gud-minor-mode gud-comint-buffer)
@@ -511,7 +511,7 @@ With arg, use separate IO iff arg is positive."
(defun gdb-var-evaluate-expression-handler (varnum changed)
(with-current-buffer (gdb-get-create-buffer 'gdb-partial-output-buffer)
(goto-char (point-min))
- (re-search-forward ".*value=\\(\".+\"\\)" nil t)
+ (re-search-forward ".*value=\\(\".*\"\\)" nil t)
(catch 'var-found
(let ((num 0))
(dolist (var gdb-var-list)
@@ -554,7 +554,7 @@ type=\"\\(.*?\\)\"")
(push varchild var-list)
(if (or (equal (nth 2 varchild) "0")
(and (equal (nth 2 varchild) "1")
- (equal (nth 3 varchild) "char *")))
+ (string-match "char \\*" (nth 3 varchild))))
(gdb-enqueue-input
(list
(concat
@@ -578,12 +578,19 @@ type=\"\\(.*?\\)\"")
(with-current-buffer (gdb-get-create-buffer 'gdb-partial-output-buffer)
(goto-char (point-min))
(while (re-search-forward gdb-var-update-regexp nil t)
+ (catch 'var-found-1
(let ((varnum (match-string 1)))
- (gdb-enqueue-input
- (list
- (concat "server interpreter mi \"-var-evaluate-expression "
- varnum "\"\n")
- `(lambda () (gdb-var-evaluate-expression-handler ,varnum t)))))))
+ (dolist (var gdb-var-list)
+ (when (and (string-equal varnum (cadr var))
+ (or (equal (nth 2 var) "0")
+ (and (equal (nth 2 var) "1")
+ (string-match "char \\*" (nth 3 var)))))
+ (gdb-enqueue-input
+ (list
+ (concat "server interpreter mi \"-var-evaluate-expression "
+ varnum "\"\n")
+ `(lambda () (gdb-var-evaluate-expression-handler ,varnum t))))
+ (throw 'var-found-1 nil)))))))
(setq gdb-pending-triggers
(delq 'gdb-var-update gdb-pending-triggers))
(when (and (boundp 'speedbar-frame) (frame-live-p speedbar-frame))