(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))
(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."