summaryrefslogtreecommitdiff
path: root/lisp/progmodes/gdb-mi.el
diff options
context:
space:
mode:
authorNick Roberts <nickrob@snap.net.nz>2009-09-11 11:55:11 +0000
committerNick Roberts <nickrob@snap.net.nz>2009-09-11 11:55:11 +0000
commitdf1bfa9d0051bb00c02504400debe3f640e40ec9 (patch)
tree49b41f373af738660860c0ce7263a0cb59f23d93 /lisp/progmodes/gdb-mi.el
parentac243a409086b037dc49ca3f9b38aa1ab5f8606d (diff)
downloademacs-df1bfa9d0051bb00c02504400debe3f640e40ec9.tar.gz
(gdb-var-update-regexp): Delete.
(gdb-var-update-handler): Use json parsing.
Diffstat (limited to 'lisp/progmodes/gdb-mi.el')
-rw-r--r--lisp/progmodes/gdb-mi.el22
1 files changed, 9 insertions, 13 deletions
diff --git a/lisp/progmodes/gdb-mi.el b/lisp/progmodes/gdb-mi.el
index 09290deb905..17e0c1c8872 100644
--- a/lisp/progmodes/gdb-mi.el
+++ b/lisp/progmodes/gdb-mi.el
@@ -1136,29 +1136,25 @@ numchild=\"\\(.+?\\)\".*?,value=\\(\"\"\\|\".*?[^\\]\"\\)\
(list "-var-update --all-values *" 'gdb-var-update-handler)))
(gdb-add-pending 'gdb-var-update))
-(defconst gdb-var-update-regexp
- "{.*?name=\"\\(.*?\\)\".*?,\\(?:value=\\(\".*?\"\\),\\)?.*?\
-in_scope=\"\\(.*?\\)\".*?}")
-
(defun gdb-var-update-handler ()
+ (let ((changelist (gdb-get-field (gdb-json-partial-output) 'changelist)))
(dolist (var gdb-var-list)
(setcar (nthcdr 5 var) nil))
- (goto-char (point-min))
- (while (re-search-forward gdb-var-update-regexp nil t)
- (let* ((varnum (match-string 1))
+ (dolist (change changelist)
+ (let* ((varnum (gdb-get-field change 'name))
(var (assoc varnum gdb-var-list)))
(when var
- (let ((match (match-string 3)))
- (cond ((string-equal match "false")
+ (let ((scope (gdb-get-field change 'in_scope)))
+ (cond ((string-equal scope "false")
(if gdb-delete-out-of-scope
(gdb-var-delete-1 varnum)
(setcar (nthcdr 5 var) 'out-of-scope)))
- ((string-equal match "true")
+ ((string-equal scope "true")
(setcar (nthcdr 5 var) 'changed)
(setcar (nthcdr 4 var)
- (read (match-string 2))))
- ((string-equal match "invalid")
- (gdb-var-delete-1 varnum)))))))
+ (gdb-get-field change 'value)))
+ ((string-equal scope "invalid")
+ (gdb-var-delete-1 varnum))))))))
(gdb-delete-pending 'gdb-var-update)
(gdb-speedbar-update))