]> git.eshelyaron.com Git - emacs.git/commitdiff
(gdb-data-list-register-values-handler):
authorNick Roberts <nickrob@snap.net.nz>
Thu, 20 Apr 2006 22:57:03 +0000 (22:57 +0000)
committerNick Roberts <nickrob@snap.net.nz>
Thu, 20 Apr 2006 22:57:03 +0000 (22:57 +0000)
Use font-lock-warning-face for any errors e.g. no stack.
(gdb-stack-list-locals-handler): Display any errors e.g. no stack.

lisp/progmodes/gdb-ui.el

index e6325f1de805c3b086816f063d32f3899b74389a..a5163319fbf8901de3f17bda3aac5f3f6a3b8da0 100644 (file)
@@ -3294,6 +3294,7 @@ in_scope=\"\\(.*?\\)\".*?}")
        (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 @@ in_scope=\"\\(.*?\\)\".*?}")
 (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."