emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] Changes to emacs/lisp/progmodes/gdb-ui.el


From: Masatake YAMATO
Subject: [Emacs-diffs] Changes to emacs/lisp/progmodes/gdb-ui.el
Date: Wed, 05 Oct 2005 13:20:07 -0400

Index: emacs/lisp/progmodes/gdb-ui.el
diff -c emacs/lisp/progmodes/gdb-ui.el:1.90 emacs/lisp/progmodes/gdb-ui.el:1.91
*** emacs/lisp/progmodes/gdb-ui.el:1.90 Tue Aug 30 10:54:08 2005
--- emacs/lisp/progmodes/gdb-ui.el      Wed Oct  5 17:20:03 2005
***************
*** 1337,1344 ****
                (setq bptno (match-string 1))
                (setq flag (char-after (match-beginning 2)))
                (beginning-of-line)
!               (if (re-search-forward " in .* at\\s-+" nil t)
                    (progn
                      (looking-at "\\(\\S-+\\):\\([0-9]+\\)")
                      (let ((line (match-string 2)) (buffer-read-only nil)
                            (file (match-string 1)))
--- 1337,1347 ----
                (setq bptno (match-string 1))
                (setq flag (char-after (match-beginning 2)))
                (beginning-of-line)
!               (if (re-search-forward " in \\(.*\\) at\\s-+" nil t)
                    (progn
+                     (let ((buffer-read-only nil))
+                       (add-text-properties (match-beginning 1) (match-end 1)
+                                            '(face 
font-lock-function-name-face)))
                      (looking-at "\\(\\S-+\\):\\([0-9]+\\)")
                      (let ((line (match-string 2)) (buffer-read-only nil)
                            (file (match-string 1)))
***************
*** 1531,1547 ****
  (defun gdb-info-frames-custom ()
    (with-current-buffer (gdb-get-buffer 'gdb-stack-buffer)
      (save-excursion
!       (let ((buffer-read-only nil))
        (goto-char (point-min))
        (while (< (point) (point-max))
!         (add-text-properties (line-beginning-position) (line-end-position)
                             '(mouse-face highlight
                               help-echo "mouse-2, RET: Select frame"))
!         (beginning-of-line)
!         (when (and (looking-at "^#\\([0-9]+\\)")
!                    (equal (match-string 1) gdb-frame-number))
!           (put-text-property (line-beginning-position) (line-end-position)
!                              'face '(:inverse-video t)))
          (forward-line 1))))))
  
  (defun gdb-stack-buffer-name ()
--- 1534,1564 ----
  (defun gdb-info-frames-custom ()
    (with-current-buffer (gdb-get-buffer 'gdb-stack-buffer)
      (save-excursion
!       (let ((buffer-read-only nil)
!           bl el)
        (goto-char (point-min))
        (while (< (point) (point-max))
!         (setq bl (line-beginning-position)
!               el (line-end-position))
!         (add-text-properties bl el
                             '(mouse-face highlight
                               help-echo "mouse-2, RET: Select frame"))
!         (goto-char bl)
!         (when (looking-at "^#\\([0-9]+\\)")
!           (if (equal (match-string 1) gdb-frame-number)
!               (put-text-property bl el 'face '(:inverse-video t))
!             (when (re-search-forward " in \\([^ ]+\\) (" el t)
!               (put-text-property (match-beginning 1) (match-end 1)
!                                  'face font-lock-function-name-face)
!               (setq bl (match-end 0))
!               (while (re-search-forward "<\\([^>]+\\)>" el t)
!                 (put-text-property (match-beginning 1) (match-end 1)
!                                    'face font-lock-function-name-face))
!               (goto-char bl)
!               (while (re-search-forward "\\(\\(\\sw\\|[_.]\\)+\\)=" el t)
!                 (put-text-property (match-beginning 1) (match-end 1)
!                                    'face font-lock-variable-name-face))
!               )))
          (forward-line 1))))))
  
  (defun gdb-stack-buffer-name ()
***************
*** 1648,1653 ****
--- 1665,1678 ----
      (define-key map [mouse-2] 'gdb-threads-select)
      map))
  
+ (defvar gdb-threads-font-lock-keywords
+   '(
+     (") +\\([^ ]+\\) ("  (1 font-lock-function-name-face))
+     ("in \\([^ ]+\\) ("  (1 font-lock-function-name-face))
+     ("\\(\\(\\sw\\|[_.]\\)+\\)="  (1 font-lock-variable-name-face))
+     )
+   "Font lock keywords used in `gdb-threads-mode'.")
+ 
  (defun gdb-threads-mode ()
    "Major mode for gdb frames.
  
***************
*** 1657,1662 ****
--- 1682,1689 ----
    (setq mode-name "Threads")
    (setq buffer-read-only t)
    (use-local-map gdb-threads-mode-map)
+   (set (make-local-variable 'font-lock-defaults)
+        '(gdb-threads-font-lock-keywords))
    (run-mode-hooks 'gdb-threads-mode-hook)
    'gdb-invalidate-threads)
  
***************
*** 1702,1707 ****
--- 1729,1740 ----
      (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.
  
***************
*** 1711,1716 ****
--- 1744,1751 ----
    (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
***************
*** 1955,1960 ****
--- 1990,2001 ----
      (define-key map (vector 'header-line 'down-mouse-1) 'ignore)
      map))
  
+ (defvar gdb-memory-font-lock-keywords
+   '(;; <__function.name+n>
+     ("<\\(\\(\\sw\\|[_.]\\)+\\)\\(\\+[0-9]+\\)?>" (1 
font-lock-function-name-face))
+     )
+   "Font lock keywords used in `gdb-memory-mode'.")
+ 
  (defun gdb-memory-mode ()
    "Major mode for examining memory.
  
***************
*** 2026,2031 ****
--- 2067,2074 ----
                       'help-echo "mouse-3: Select unit size"
                       'mouse-face 'mode-line-highlight
                       'local-map gdb-memory-unit-keymap))))
+   (set (make-local-variable 'font-lock-defaults)
+        '(gdb-memory-font-lock-keywords))
    (run-mode-hooks 'gdb-memory-mode-hook)
    'gdb-invalidate-memory)
  
***************
*** 2094,2099 ****
--- 2137,2159 ----
      (define-key map "q" 'kill-this-buffer)
       map))
  
+ (defvar gdb-local-font-lock-keywords
+   '(
+     ;; var = (struct struct_tag) value
+     ( "\\(^\\(\\sw\\|[_.]\\)+\\) += +(\\(struct\\) \\(\\(\\sw\\|[_.]\\)+\\)"
+       (1 font-lock-variable-name-face)
+       (3 font-lock-keyword-face)
+       (4 font-lock-type-face))
+     ;; var = (type) value 
+     ( "\\(^\\(\\sw\\|[_.]\\)+\\) += +(\\(\\(\\sw\\|[_.]\\)+\\)"
+       (1 font-lock-variable-name-face)
+       (3 font-lock-type-face))
+     ;; var = val
+     ( "\\(^\\(\\sw\\|[_.]\\)+\\) += +[^(]"
+       (1 font-lock-variable-name-face))
+     )
+   "Font lock keywords used in `gdb-local-mode'.")
+ 
  (defun gdb-locals-mode ()
    "Major mode for gdb locals.
  
***************
*** 2103,2108 ****
--- 2163,2170 ----
    (setq mode-name (concat "Locals:" gdb-selected-frame))
    (setq buffer-read-only t)
    (use-local-map gdb-locals-mode-map)
+   (set (make-local-variable 'font-lock-defaults)
+        '(gdb-local-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




reply via email to

[Prev in Thread] Current Thread [Next in Thread]