diff options
| author | Nick Roberts | 2006-04-20 22:57:03 +0000 |
|---|---|---|
| committer | Nick Roberts | 2006-04-20 22:57:03 +0000 |
| commit | eff8536f409853cd171834472b237d9c850e40e2 (patch) | |
| tree | 4cf7c48813bbd893d3331c2381a527cc09f046e5 | |
| parent | b65dd3408ade666b6c4c1690c0c3652010585b8e (diff) | |
| download | emacs-eff8536f409853cd171834472b237d9c850e40e2.tar.gz emacs-eff8536f409853cd171834472b237d9c850e40e2.zip | |
(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.
| -rw-r--r-- | lisp/progmodes/gdb-ui.el | 63 |
1 files changed, 36 insertions, 27 deletions
diff --git a/lisp/progmodes/gdb-ui.el b/lisp/progmodes/gdb-ui.el index e6325f1de80..a5163319fbf 100644 --- a/lisp/progmodes/gdb-ui.el +++ b/lisp/progmodes/gdb-ui.el | |||
| @@ -3294,6 +3294,7 @@ in_scope=\"\\(.*?\\)\".*?}") | |||
| 3294 | (with-current-buffer (gdb-get-buffer 'gdb-registers-buffer) | 3294 | (with-current-buffer (gdb-get-buffer 'gdb-registers-buffer) |
| 3295 | (let ((buffer-read-only nil)) | 3295 | (let ((buffer-read-only nil)) |
| 3296 | (erase-buffer) | 3296 | (erase-buffer) |
| 3297 | (put-text-property 0 (length err) 'face font-lock-warning-face err) | ||
| 3297 | (insert err) | 3298 | (insert err) |
| 3298 | (goto-char (point-min))))) | 3299 | (goto-char (point-min))))) |
| 3299 | (let ((register-list (reverse gdb-register-names)) | 3300 | (let ((register-list (reverse gdb-register-names)) |
| @@ -3390,36 +3391,44 @@ in_scope=\"\\(.*?\\)\".*?}") | |||
| 3390 | (defun gdb-stack-list-locals-handler () | 3391 | (defun gdb-stack-list-locals-handler () |
| 3391 | (setq gdb-pending-triggers (delq 'gdb-invalidate-locals-1 | 3392 | (setq gdb-pending-triggers (delq 'gdb-invalidate-locals-1 |
| 3392 | gdb-pending-triggers)) | 3393 | gdb-pending-triggers)) |
| 3393 | (let (local locals-list) | 3394 | (goto-char (point-min)) |
| 3394 | (goto-char (point-min)) | 3395 | (if (re-search-forward gdb-error-regexp nil t) |
| 3395 | (while (re-search-forward gdb-stack-list-locals-regexp nil t) | 3396 | (let ((err (match-string 1))) |
| 3396 | (let ((local (list (match-string 1) | 3397 | (with-current-buffer (gdb-get-buffer 'gdb-locals-buffer) |
| 3397 | (match-string 2) | 3398 | (let ((buffer-read-only nil)) |
| 3398 | nil))) | 3399 | (erase-buffer) |
| 3399 | (if (looking-at ",value=\\(\".*\"\\).*?}") | 3400 | (insert err) |
| 3400 | (setcar (nthcdr 2 local) (read (match-string 1)))) | 3401 | (goto-char (point-min))))) |
| 3401 | (push local locals-list))) | 3402 | (let (local locals-list) |
| 3402 | (let ((buf (gdb-get-buffer 'gdb-locals-buffer))) | 3403 | (goto-char (point-min)) |
| 3403 | (and buf (with-current-buffer buf | 3404 | (while (re-search-forward gdb-stack-list-locals-regexp nil t) |
| 3404 | (let* ((window (get-buffer-window buf 0)) | 3405 | (let ((local (list (match-string 1) |
| 3405 | (start (window-start window)) | 3406 | (match-string 2) |
| 3406 | (p (window-point window)) | 3407 | nil))) |
| 3407 | (buffer-read-only nil)) | 3408 | (if (looking-at ",value=\\(\".*\"\\).*?}") |
| 3408 | (erase-buffer) | 3409 | (setcar (nthcdr 2 local) (read (match-string 1)))) |
| 3409 | (dolist (local locals-list) | 3410 | (push local locals-list))) |
| 3410 | (setq name (car local)) | 3411 | (let ((buf (gdb-get-buffer 'gdb-locals-buffer))) |
| 3411 | (if (or (not (nth 2 local)) | 3412 | (and buf (with-current-buffer buf |
| 3412 | (string-match "\\0x" (nth 2 local))) | 3413 | (let* ((window (get-buffer-window buf 0)) |
| 3413 | (add-text-properties 0 (length name) | 3414 | (start (window-start window)) |
| 3414 | `(mouse-face highlight | 3415 | (p (window-point window)) |
| 3415 | help-echo "mouse-2: create watch expression" | 3416 | (buffer-read-only nil)) |
| 3416 | local-map ,gdb-locals-watch-map-1) | 3417 | (erase-buffer) |
| 3417 | name)) | 3418 | (dolist (local locals-list) |
| 3419 | (setq name (car local)) | ||
| 3420 | (if (or (not (nth 2 local)) | ||
| 3421 | (string-match "^\\0x" (nth 2 local))) | ||
| 3422 | (add-text-properties 0 (length name) | ||
| 3423 | `(mouse-face highlight | ||
| 3424 | help-echo "mouse-2: create watch expression" | ||
| 3425 | local-map ,gdb-locals-watch-map-1) | ||
| 3426 | name)) | ||
| 3418 | (insert | 3427 | (insert |
| 3419 | (concat name "\t" (nth 1 local) | 3428 | (concat name "\t" (nth 1 local) |
| 3420 | "\t" (nth 2 local) "\n"))) | 3429 | "\t" (nth 2 local) "\n"))) |
| 3421 | (set-window-start window start) | 3430 | (set-window-start window start) |
| 3422 | (set-window-point window p))))))) | 3431 | (set-window-point window p)))))))) |
| 3423 | 3432 | ||
| 3424 | (defun gdb-get-register-names () | 3433 | (defun gdb-get-register-names () |
| 3425 | "Create a list of register names." | 3434 | "Create a list of register names." |