/[emacs]/emacs/lisp/progmodes/gdb-ui.el
ViewVC logotype

Diff of /emacs/lisp/progmodes/gdb-ui.el

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.102 by nickrob, Wed Oct 26 01:01:34 2005 UTC revision 1.103 by nickrob, Sun Oct 30 12:10:14 2005 UTC
# Line 50  Line 50 
50  ;; still under development and is part of a process to migrate Emacs from  ;; still under development and is part of a process to migrate Emacs from
51  ;; annotations to GDB/MI.  ;; annotations to GDB/MI.
52  ;;  ;;
53    ;; This mode SHOULD WORK WITH GDB 5.0 ONWARDS but you will NEED GDB 6.0
54    ;; ONWARDS TO USE WATCH EXPRESSIONS.
55    ;;
56  ;; Windows Platforms:  ;; Windows Platforms:
57  ;;  ;;
58  ;; If you are using Emacs and GDB on Windows you will need to flush the buffer  ;; If you are using Emacs and GDB on Windows you will need to flush the buffer
# Line 277  Also display the main routine in the dis Line 280  Also display the main routine in the dis
280    (with-current-buffer (gdb-get-buffer 'gdb-partial-output-buffer)    (with-current-buffer (gdb-get-buffer 'gdb-partial-output-buffer)
281      (goto-char (point-min))      (goto-char (point-min))
282      (if (search-forward "expands to: " nil t)      (if (search-forward "expands to: " nil t)
283          (unless (looking-at "\\S+.*(.*).*")          (unless (looking-at "\\S-+.*(.*).*")
284            (gdb-enqueue-input            (gdb-enqueue-input
285             (list  (concat gdb-server-prefix "print " expr "\n")             (list  (concat gdb-server-prefix "print " expr "\n")
286                    'gdb-tooltip-print))))))                    'gdb-tooltip-print))))))
# Line 1777  static char *magick[] = { Line 1780  static char *magick[] = {
1780    gdb-info-registers-handler    gdb-info-registers-handler
1781    gdb-info-registers-custom)    gdb-info-registers-custom)
1782    
1783  (defun gdb-info-registers-custom ())  (defun gdb-info-registers-custom ()
1784      (with-current-buffer (gdb-get-buffer 'gdb-registers-buffer)
1785        (save-excursion
1786          (let ((buffer-read-only nil)
1787                bl)
1788            (goto-char (point-min))
1789            (while (< (point) (point-max))
1790              (setq bl (line-beginning-position))
1791              (when (looking-at "^[^ ]+")
1792                (put-text-property bl (match-end 0)
1793                                   'face font-lock-variable-name-face))
1794              (forward-line 1))))))
1795    
1796  (defvar gdb-registers-mode-map  (defvar gdb-registers-mode-map
1797    (let ((map (make-sparse-keymap)))    (let ((map (make-sparse-keymap)))
# Line 1786  static char *magick[] = { Line 1800  static char *magick[] = {
1800      (define-key map "q" 'kill-this-buffer)      (define-key map "q" 'kill-this-buffer)
1801       map))       map))
1802    
 (defvar gdb-registers-font-lock-keywords  
   '(  
     ("^[^ ]+" . font-lock-variable-name-face)  
     )  
   "Font lock keywords used in `gdb-registers-mode'.")  
   
1803  (defun gdb-registers-mode ()  (defun gdb-registers-mode ()
1804    "Major mode for gdb registers.    "Major mode for gdb registers.
1805    
# Line 1801  static char *magick[] = { Line 1809  static char *magick[] = {
1809    (setq mode-name "Registers:")    (setq mode-name "Registers:")
1810    (setq buffer-read-only t)    (setq buffer-read-only t)
1811    (use-local-map gdb-registers-mode-map)    (use-local-map gdb-registers-mode-map)
   (set (make-local-variable 'font-lock-defaults)  
        '(gdb-registers-font-lock-keywords))  
1812    (run-mode-hooks 'gdb-registers-mode-hook)    (run-mode-hooks 'gdb-registers-mode-hook)
1813    (if (with-current-buffer gud-comint-buffer (eq gud-minor-mode 'gdba))    (if (with-current-buffer gud-comint-buffer (eq gud-minor-mode 'gdba))
1814        'gdb-invalidate-registers        'gdb-invalidate-registers
# Line 2160  corresponding to the mode line clicked." Line 2166  corresponding to the mode line clicked."
2166    
2167  ;; Abbreviate for arrays and structures.  ;; Abbreviate for arrays and structures.
2168  ;; These can be expanded using gud-display.  ;; These can be expanded using gud-display.
2169  (defun gdb-info-locals-handler nil  (defun gdb-info-locals-handler ()
2170    (setq gdb-pending-triggers (delq 'gdb-invalidate-locals    (setq gdb-pending-triggers (delq 'gdb-invalidate-locals
2171                                    gdb-pending-triggers))                                    gdb-pending-triggers))
2172    (let ((buf (gdb-get-buffer 'gdb-partial-output-buffer)))    (let ((buf (gdb-get-buffer 'gdb-partial-output-buffer)))
# Line 2192  corresponding to the mode line clicked." Line 2198  corresponding to the mode line clicked."
2198      (define-key map "q" 'kill-this-buffer)      (define-key map "q" 'kill-this-buffer)
2199       map))       map))
2200    
2201  (defvar gdb-local-font-lock-keywords  (defvar gdb-locals-font-lock-keywords
2202    '(    '(
2203      ;; var = (struct struct_tag) value      ;; var = (struct struct_tag) value
2204      ( "\\(^\\(\\sw\\|[_.]\\)+\\) += +(\\(struct\\) \\(\\(\\sw\\|[_.]\\)+\\)"      ( "\\(^\\(\\sw\\|[_.]\\)+\\) += +(\\(struct\\) \\(\\(\\sw\\|[_.]\\)+\\)"
# Line 2219  corresponding to the mode line clicked." Line 2225  corresponding to the mode line clicked."
2225    (setq buffer-read-only t)    (setq buffer-read-only t)
2226    (use-local-map gdb-locals-mode-map)    (use-local-map gdb-locals-mode-map)
2227    (set (make-local-variable 'font-lock-defaults)    (set (make-local-variable 'font-lock-defaults)
2228         '(gdb-local-font-lock-keywords))         '(gdb-locals-font-lock-keywords))
2229    (run-mode-hooks 'gdb-locals-mode-hook)    (run-mode-hooks 'gdb-locals-mode-hook)
2230    (if (with-current-buffer gud-comint-buffer (eq gud-minor-mode 'gdba))    (if (with-current-buffer gud-comint-buffer (eq gud-minor-mode 'gdba))
2231        'gdb-invalidate-locals        'gdb-invalidate-locals

Legend:
Removed from v.1.102  
changed lines
  Added in v.1.103

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26