changeset 66554:ba2cdafde956

(gdb-tooltip-print-1): Fix regexp. (gdb-registers-font-lock-keywords): Delete. (gdb-registers-mode): Don't fontify. (gdb-info-registers-custom): Use text properties instead as, in future, changed register values will use font-lock-warning-face. (gdb-local-font-lock-keywords): Rename to... (gdb-locals-font-lock-keywords): ...for consistency.
author Nick Roberts <nickrob@snap.net.nz>
date Sun, 30 Oct 2005 12:10:14 +0000
parents d704f7aa82e8
children 6c85f5b61c07
files lisp/progmodes/gdb-ui.el
diffstat 1 files changed, 19 insertions(+), 13 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/progmodes/gdb-ui.el	Sun Oct 30 12:09:08 2005 +0000
+++ b/lisp/progmodes/gdb-ui.el	Sun Oct 30 12:10:14 2005 +0000
@@ -50,6 +50,9 @@
 ;; still under development and is part of a process to migrate Emacs from
 ;; annotations to GDB/MI.
 ;;
+;; This mode SHOULD WORK WITH GDB 5.0 ONWARDS but you will NEED GDB 6.0
+;; ONWARDS TO USE WATCH EXPRESSIONS.
+;;
 ;; Windows Platforms:
 ;;
 ;; If you are using Emacs and GDB on Windows you will need to flush the buffer
@@ -277,7 +280,7 @@
   (with-current-buffer (gdb-get-buffer 'gdb-partial-output-buffer)
     (goto-char (point-min))
     (if (search-forward "expands to: " nil t)
-	(unless (looking-at "\\S+.*(.*).*")
+	(unless (looking-at "\\S-+.*(.*).*")
 	  (gdb-enqueue-input
 	   (list  (concat gdb-server-prefix "print " expr "\n")
 		  'gdb-tooltip-print))))))
@@ -1777,7 +1780,18 @@
   gdb-info-registers-handler
   gdb-info-registers-custom)
 
-(defun gdb-info-registers-custom ())
+(defun gdb-info-registers-custom ()
+  (with-current-buffer (gdb-get-buffer 'gdb-registers-buffer)
+    (save-excursion
+      (let ((buffer-read-only nil)
+	    bl)
+	(goto-char (point-min))
+	(while (< (point) (point-max))
+	  (setq bl (line-beginning-position))
+	  (when (looking-at "^[^ ]+")
+	    (put-text-property bl (match-end 0)
+			       'face font-lock-variable-name-face))
+	  (forward-line 1))))))
 
 (defvar gdb-registers-mode-map
   (let ((map (make-sparse-keymap)))
@@ -1786,12 +1800,6 @@
     (define-key map "q" 'kill-this-buffer)
      map))
 
-(defvar gdb-registers-font-lock-keywords
-  '(
-    ("^[^ ]+" . font-lock-variable-name-face)
-    )
-  "Font lock keywords used in `gdb-registers-mode'.")
-
 (defun gdb-registers-mode ()
   "Major mode for gdb registers.
 
@@ -1801,8 +1809,6 @@
   (setq mode-name "Registers:")
   (setq buffer-read-only t)
   (use-local-map gdb-registers-mode-map)
-  (set (make-local-variable 'font-lock-defaults)
-       '(gdb-registers-font-lock-keywords))
   (run-mode-hooks 'gdb-registers-mode-hook)
   (if (with-current-buffer gud-comint-buffer (eq gud-minor-mode 'gdba))
       'gdb-invalidate-registers
@@ -2160,7 +2166,7 @@
 
 ;; Abbreviate for arrays and structures.
 ;; These can be expanded using gud-display.
-(defun gdb-info-locals-handler nil
+(defun gdb-info-locals-handler ()
   (setq gdb-pending-triggers (delq 'gdb-invalidate-locals
 				  gdb-pending-triggers))
   (let ((buf (gdb-get-buffer 'gdb-partial-output-buffer)))
@@ -2192,7 +2198,7 @@
     (define-key map "q" 'kill-this-buffer)
      map))
 
-(defvar gdb-local-font-lock-keywords
+(defvar gdb-locals-font-lock-keywords
   '(
     ;; var = (struct struct_tag) value
     ( "\\(^\\(\\sw\\|[_.]\\)+\\) += +(\\(struct\\) \\(\\(\\sw\\|[_.]\\)+\\)"
@@ -2219,7 +2225,7 @@
   (setq buffer-read-only t)
   (use-local-map gdb-locals-mode-map)
   (set (make-local-variable 'font-lock-defaults)
-       '(gdb-local-font-lock-keywords))
+       '(gdb-locals-font-lock-keywords))
   (run-mode-hooks 'gdb-locals-mode-hook)
   (if (with-current-buffer gud-comint-buffer (eq gud-minor-mode 'gdba))
       'gdb-invalidate-locals