Mercurial > emacs
changeset 70141:21438c8b3a3f
(gdb-data-list-register-values-handler):
Use font-lock-warning-face for any errors e.g. no stack.
(gdb-stack-list-locals-handler): Display any errors e.g. no stack.
author | Nick Roberts <nickrob@snap.net.nz> |
---|---|
date | Thu, 20 Apr 2006 22:57:03 +0000 |
parents | e7260a496ebf |
children | aaccd198c2be |
files | lisp/progmodes/gdb-ui.el |
diffstat | 1 files changed, 36 insertions(+), 27 deletions(-) [+] |
line wrap: on
line diff
--- a/lisp/progmodes/gdb-ui.el Thu Apr 20 22:52:16 2006 +0000 +++ b/lisp/progmodes/gdb-ui.el Thu Apr 20 22:57:03 2006 +0000 @@ -3294,6 +3294,7 @@ (with-current-buffer (gdb-get-buffer 'gdb-registers-buffer) (let ((buffer-read-only nil)) (erase-buffer) + (put-text-property 0 (length err) 'face font-lock-warning-face err) (insert err) (goto-char (point-min))))) (let ((register-list (reverse gdb-register-names)) @@ -3390,36 +3391,44 @@ (defun gdb-stack-list-locals-handler () (setq gdb-pending-triggers (delq 'gdb-invalidate-locals-1 gdb-pending-triggers)) - (let (local locals-list) - (goto-char (point-min)) - (while (re-search-forward gdb-stack-list-locals-regexp nil t) - (let ((local (list (match-string 1) - (match-string 2) - nil))) - (if (looking-at ",value=\\(\".*\"\\).*?}") - (setcar (nthcdr 2 local) (read (match-string 1)))) - (push local locals-list))) - (let ((buf (gdb-get-buffer 'gdb-locals-buffer))) - (and buf (with-current-buffer buf - (let* ((window (get-buffer-window buf 0)) - (start (window-start window)) - (p (window-point window)) - (buffer-read-only nil)) - (erase-buffer) - (dolist (local locals-list) - (setq name (car local)) - (if (or (not (nth 2 local)) - (string-match "\\0x" (nth 2 local))) - (add-text-properties 0 (length name) - `(mouse-face highlight - help-echo "mouse-2: create watch expression" - local-map ,gdb-locals-watch-map-1) - name)) + (goto-char (point-min)) + (if (re-search-forward gdb-error-regexp nil t) + (let ((err (match-string 1))) + (with-current-buffer (gdb-get-buffer 'gdb-locals-buffer) + (let ((buffer-read-only nil)) + (erase-buffer) + (insert err) + (goto-char (point-min))))) + (let (local locals-list) + (goto-char (point-min)) + (while (re-search-forward gdb-stack-list-locals-regexp nil t) + (let ((local (list (match-string 1) + (match-string 2) + nil))) + (if (looking-at ",value=\\(\".*\"\\).*?}") + (setcar (nthcdr 2 local) (read (match-string 1)))) + (push local locals-list))) + (let ((buf (gdb-get-buffer 'gdb-locals-buffer))) + (and buf (with-current-buffer buf + (let* ((window (get-buffer-window buf 0)) + (start (window-start window)) + (p (window-point window)) + (buffer-read-only nil)) + (erase-buffer) + (dolist (local locals-list) + (setq name (car local)) + (if (or (not (nth 2 local)) + (string-match "^\\0x" (nth 2 local))) + (add-text-properties 0 (length name) + `(mouse-face highlight + help-echo "mouse-2: create watch expression" + local-map ,gdb-locals-watch-map-1) + name)) (insert (concat name "\t" (nth 1 local) "\t" (nth 2 local) "\n"))) - (set-window-start window start) - (set-window-point window p))))))) + (set-window-start window start) + (set-window-point window p)))))))) (defun gdb-get-register-names () "Create a list of register names."