Mercurial > emacs
comparison lisp/progmodes/gdb-ui.el @ 94348:912b9ac13852
(gud-watch): Don't create speedbar...
(gdb-var-create-handler): ...until here when there are values.
(gdb-post-prompt): Don't do -var-update with no watch expressions.
(gdb-info-locals-handler): Don't match "struct {...}" as an array.
author | Nick Roberts <nickrob@snap.net.nz> |
---|---|
date | Fri, 25 Apr 2008 10:59:20 +0000 |
parents | bac78d3bb2ee |
children | 52a0ed7601cb |
comparison
equal
deleted
inserted
replaced
94347:98369e6ef8ea | 94348:912b9ac13852 |
---|---|
755 'gud-gdb-complete-command) | 755 'gud-gdb-complete-command) |
756 (if (and transient-mark-mode mark-active) | 756 (if (and transient-mark-mode mark-active) |
757 (buffer-substring (region-beginning) (region-end)) | 757 (buffer-substring (region-beginning) (region-end)) |
758 (concat (if (eq major-mode 'gdb-registers-mode) "$") | 758 (concat (if (eq major-mode 'gdb-registers-mode) "$") |
759 (tooltip-identifier-from-point (point))))))) | 759 (tooltip-identifier-from-point (point))))))) |
760 (speedbar 1) | 760 (set-text-properties 0 (length expr) nil expr) |
761 (set-text-properties 0 (length expr) nil expr) | 761 (gdb-enqueue-input |
762 (gdb-enqueue-input | 762 (list |
763 (list | 763 (if (eq minor-mode 'gdba) |
764 (if (eq minor-mode 'gdba) | 764 (concat |
765 (concat | 765 "server interpreter mi \"-var-create - * " expr "\"\n") |
766 "server interpreter mi \"-var-create - * " expr "\"\n") | 766 (concat"-var-create - * " expr "\n")) |
767 (concat"-var-create - * " expr "\n")) | 767 `(lambda () (gdb-var-create-handler ,expr))))))) |
768 `(lambda () (gdb-var-create-handler ,expr))))))) | |
769 (message "gud-watch is a no-op in this mode.")))) | 768 (message "gud-watch is a no-op in this mode.")))) |
770 | 769 |
771 (defconst gdb-var-create-regexp | 770 (defconst gdb-var-create-regexp |
772 "name=\"\\(.*?\\)\",.*numchild=\"\\(.*?\\)\",\\(?:.*value=\\(\".*\"\\),\\)?.*type=\"\\(.*?\\)\"") | 771 "name=\"\\(.*?\\)\",.*numchild=\"\\(.*?\\)\",\\(?:.*value=\\(\".*\"\\),\\)?.*type=\"\\(.*?\\)\"") |
773 | 772 |
783 (match-string 2) | 782 (match-string 2) |
784 (match-string 4) | 783 (match-string 4) |
785 (if (match-string 3) (read (match-string 3))) | 784 (if (match-string 3) (read (match-string 3))) |
786 nil gdb-frame-address))) | 785 nil gdb-frame-address))) |
787 (push var gdb-var-list) | 786 (push var gdb-var-list) |
787 (speedbar 1) | |
788 (unless (string-equal | 788 (unless (string-equal |
789 speedbar-initial-expansion-list-name "GUD") | 789 speedbar-initial-expansion-list-name "GUD") |
790 (speedbar-change-initial-expansion-list "GUD")) | 790 (speedbar-change-initial-expansion-list "GUD")) |
791 (unless (nth 4 var) | 791 (unless (nth 4 var) |
792 (gdb-enqueue-input | 792 (gdb-enqueue-input |
1561 (if (string-equal gdb-version "pre-6.4") | 1561 (if (string-equal gdb-version "pre-6.4") |
1562 (gdb-invalidate-locals) | 1562 (gdb-invalidate-locals) |
1563 (gdb-invalidate-locals-1)) | 1563 (gdb-invalidate-locals-1)) |
1564 | 1564 |
1565 (gdb-invalidate-threads) | 1565 (gdb-invalidate-threads) |
1566 (unless (eq system-type 'darwin) ;Breaks on Darwin's GDB-5.3. | 1566 (unless (or (null gdb-var-list) |
1567 (eq system-type 'darwin)) ;Breaks on Darwin's GDB-5.3. | |
1567 ;; FIXME: with GDB-6 on Darwin, this might very well work. | 1568 ;; FIXME: with GDB-6 on Darwin, this might very well work. |
1568 ;; Only needed/used with speedbar/watch expressions. | 1569 ;; Only needed/used with speedbar/watch expressions. |
1569 (when (and (boundp 'speedbar-frame) (frame-live-p speedbar-frame)) | 1570 (when (and (boundp 'speedbar-frame) (frame-live-p speedbar-frame)) |
1570 (if (string-equal gdb-version "pre-6.4") | 1571 (if (string-equal gdb-version "pre-6.4") |
1571 (gdb-var-update) | 1572 (gdb-var-update) |
2982 (setq gdb-pending-triggers (delq 'gdb-invalidate-locals | 2983 (setq gdb-pending-triggers (delq 'gdb-invalidate-locals |
2983 gdb-pending-triggers)) | 2984 gdb-pending-triggers)) |
2984 (let ((buf (gdb-get-buffer 'gdb-partial-output-buffer))) | 2985 (let ((buf (gdb-get-buffer 'gdb-partial-output-buffer))) |
2985 (with-current-buffer buf | 2986 (with-current-buffer buf |
2986 (goto-char (point-min)) | 2987 (goto-char (point-min)) |
2988 ;; Need this in case "set print pretty" is on. | |
2987 (while (re-search-forward "^[ }].*\n" nil t) | 2989 (while (re-search-forward "^[ }].*\n" nil t) |
2988 (replace-match "" nil nil)) | 2990 (replace-match "" nil nil)) |
2989 (goto-char (point-min)) | 2991 (goto-char (point-min)) |
2990 (while (re-search-forward "{\\(.*=.*\n\\|\n\\)" nil t) | 2992 (while (re-search-forward "{\\(.*=.*\n\\|\n\\)" nil t) |
2991 (replace-match gdb-struct-string nil nil)) | 2993 (replace-match gdb-struct-string nil nil)) |
2992 (goto-char (point-min)) | 2994 (goto-char (point-min)) |
2993 (while (re-search-forward "\\s-*{.*\n" nil t) | 2995 (while (re-search-forward "\\s-*{[^.].*\n" nil t) |
2994 (replace-match gdb-array-string nil nil)))) | 2996 (replace-match gdb-array-string nil nil)))) |
2995 (let ((buf (gdb-get-buffer 'gdb-locals-buffer))) | 2997 (let ((buf (gdb-get-buffer 'gdb-locals-buffer))) |
2996 (and buf | 2998 (and buf |
2997 (with-current-buffer buf | 2999 (with-current-buffer buf |
2998 (let* ((window (get-buffer-window buf 0)) | 3000 (let* ((window (get-buffer-window buf 0)) |