Mercurial > emacs
comparison lisp/progmodes/gdb-ui.el @ 94231:c0d59c1fcc51
(gdb-locals-header): New variable.
(gdb-locals-mode, gdb-registers-mode): Use it for header line.
author | Nick Roberts <nickrob@snap.net.nz> |
---|---|
date | Tue, 22 Apr 2008 05:57:37 +0000 |
parents | c5e5de94d51f |
children | 37605d9673f1 |
comparison
equal
deleted
inserted
replaced
94230:7579b6f924c3 | 94231:c0d59c1fcc51 |
---|---|
194 (defvar gdb-source-file-list nil | 194 (defvar gdb-source-file-list nil |
195 "List of source files for the current executable.") | 195 "List of source files for the current executable.") |
196 (defconst gdb-error-regexp "\\^error,msg=\"\\(.+\\)\"") | 196 (defconst gdb-error-regexp "\\^error,msg=\"\\(.+\\)\"") |
197 | 197 |
198 (defvar gdb-locals-font-lock-keywords-1 | 198 (defvar gdb-locals-font-lock-keywords-1 |
199 '( | 199 '(;; var = (struct struct_tag) value |
200 ;; var = (struct struct_tag) value | |
201 ( "\\(^\\(\\sw\\|[_.]\\)+\\) += +(\\(struct\\) \\(\\(\\sw\\|[_.]\\)+\\)" | 200 ( "\\(^\\(\\sw\\|[_.]\\)+\\) += +(\\(struct\\) \\(\\(\\sw\\|[_.]\\)+\\)" |
202 (1 font-lock-variable-name-face) | 201 (1 font-lock-variable-name-face) |
203 (3 font-lock-keyword-face) | 202 (3 font-lock-keyword-face) |
204 (4 font-lock-type-face)) | 203 (4 font-lock-type-face)) |
205 ;; var = (type) value | 204 ;; var = (type) value |
206 ( "\\(^\\(\\sw\\|[_.]\\)+\\) += +(\\(\\(\\sw\\|[_.]\\)+\\)" | 205 ( "\\(^\\(\\sw\\|[_.]\\)+\\) += +(\\(\\(\\sw\\|[_.]\\)+\\)" |
207 (1 font-lock-variable-name-face) | 206 (1 font-lock-variable-name-face) |
208 (3 font-lock-type-face)) | 207 (3 font-lock-type-face)) |
209 ;; var = val | 208 ;; var = val |
210 ( "\\(^\\(\\sw\\|[_.]\\)+\\) += +[^(]" | 209 ( "\\(^\\(\\sw\\|[_.]\\)+\\) += +[^(]" |
211 (1 font-lock-variable-name-face)) | 210 (1 font-lock-variable-name-face))) |
212 ) | |
213 "Font lock keywords used in `gdb-local-mode'.") | 211 "Font lock keywords used in `gdb-local-mode'.") |
214 | 212 |
215 (defvar gdb-locals-font-lock-keywords-2 | 213 (defvar gdb-locals-font-lock-keywords-2 |
216 '( | 214 '(;; var = type value |
217 ;; var = type value | |
218 ( "\\(^\\(\\sw\\|[_.]\\)+\\)\t+\\(\\(\\sw\\|[_.]\\)+\\)" | 215 ( "\\(^\\(\\sw\\|[_.]\\)+\\)\t+\\(\\(\\sw\\|[_.]\\)+\\)" |
219 (1 font-lock-variable-name-face) | 216 (1 font-lock-variable-name-face) |
220 (3 font-lock-type-face)) | 217 (3 font-lock-type-face))) |
221 ) | |
222 "Font lock keywords used in `gdb-local-mode'.") | 218 "Font lock keywords used in `gdb-local-mode'.") |
223 | 219 |
224 ;; Variables for GDB 6.4+ | 220 ;; Variables for GDB 6.4+ |
225 (defvar gdb-register-names nil "List of register names.") | 221 (defvar gdb-register-names nil "List of register names.") |
226 (defvar gdb-changed-registers nil | 222 (defvar gdb-changed-registers nil |
2551 (define-key map [mouse-2] 'gdb-edit-register-value) | 2547 (define-key map [mouse-2] 'gdb-edit-register-value) |
2552 (define-key map " " 'gdb-all-registers) | 2548 (define-key map " " 'gdb-all-registers) |
2553 (define-key map "q" 'kill-this-buffer) | 2549 (define-key map "q" 'kill-this-buffer) |
2554 map)) | 2550 map)) |
2555 | 2551 |
2552 (defvar gdb-locals-header | |
2553 `(,(propertize "Locals" | |
2554 'help-echo "mouse-1: select" | |
2555 'mouse-face 'mode-line-highlight | |
2556 'face 'mode-line | |
2557 'local-map | |
2558 (gdb-make-header-line-mouse-map | |
2559 'mouse-1 | |
2560 (lambda (event) (interactive "e") | |
2561 (save-selected-window | |
2562 (select-window (posn-window (event-start event))) | |
2563 (set-window-dedicated-p (selected-window) nil) | |
2564 (switch-to-buffer | |
2565 (gdb-get-buffer-create 'gdb-locals-buffer)) | |
2566 (set-window-dedicated-p (selected-window) t))))) | |
2567 " " | |
2568 ,(propertize "Registers" | |
2569 'help-echo "mouse-1: select" | |
2570 'mouse-face 'mode-line-highlight | |
2571 'face 'mode-line | |
2572 'local-map | |
2573 (gdb-make-header-line-mouse-map | |
2574 'mouse-1 | |
2575 (lambda (event) (interactive "e") | |
2576 (save-selected-window | |
2577 (select-window (posn-window (event-start event))) | |
2578 (set-window-dedicated-p (selected-window) nil) | |
2579 (switch-to-buffer | |
2580 (gdb-get-buffer-create 'gdb-registers-buffer)) | |
2581 (set-window-dedicated-p (selected-window) t))))))) | |
2582 | |
2556 (defun gdb-registers-mode () | 2583 (defun gdb-registers-mode () |
2557 "Major mode for gdb registers. | 2584 "Major mode for gdb registers. |
2558 | 2585 |
2559 \\{gdb-registers-mode-map}" | 2586 \\{gdb-registers-mode-map}" |
2560 (kill-all-local-variables) | 2587 (kill-all-local-variables) |
2561 (setq major-mode 'gdb-registers-mode) | 2588 (setq major-mode 'gdb-registers-mode) |
2562 (setq mode-name "Registers") | 2589 (setq mode-name "Registers") |
2590 (setq header-line-format gdb-locals-header) | |
2563 (setq buffer-read-only t) | 2591 (setq buffer-read-only t) |
2564 (gdb-thread-identification) | 2592 (gdb-thread-identification) |
2565 (use-local-map gdb-registers-mode-map) | 2593 (use-local-map gdb-registers-mode-map) |
2566 (run-mode-hooks 'gdb-registers-mode-hook) | 2594 (run-mode-hooks 'gdb-registers-mode-hook) |
2567 (if (string-equal gdb-version "pre-6.4") | 2595 (if (string-equal gdb-version "pre-6.4") |
2983 | 3011 |
2984 \\{gdb-locals-mode-map}" | 3012 \\{gdb-locals-mode-map}" |
2985 (kill-all-local-variables) | 3013 (kill-all-local-variables) |
2986 (setq major-mode 'gdb-locals-mode) | 3014 (setq major-mode 'gdb-locals-mode) |
2987 (setq mode-name (concat "Locals:" gdb-selected-frame)) | 3015 (setq mode-name (concat "Locals:" gdb-selected-frame)) |
3016 (use-local-map gdb-locals-mode-map) | |
2988 (setq buffer-read-only t) | 3017 (setq buffer-read-only t) |
3018 (setq header-line-format gdb-locals-header) | |
2989 (gdb-thread-identification) | 3019 (gdb-thread-identification) |
2990 (use-local-map gdb-locals-mode-map) | |
2991 (set (make-local-variable 'font-lock-defaults) | 3020 (set (make-local-variable 'font-lock-defaults) |
2992 '(gdb-locals-font-lock-keywords)) | 3021 '(gdb-locals-font-lock-keywords)) |
2993 (run-mode-hooks 'gdb-locals-mode-hook) | 3022 (run-mode-hooks 'gdb-locals-mode-hook) |
2994 (if (and (eq (buffer-local-value 'gud-minor-mode gud-comint-buffer) 'gdba) | 3023 (if (and (eq (buffer-local-value 'gud-minor-mode gud-comint-buffer) 'gdba) |
2995 (string-equal gdb-version "pre-6.4")) | 3024 (string-equal gdb-version "pre-6.4")) |