Mercurial > emacs
comparison lisp/progmodes/gdb-ui.el @ 96009:8e1702dc030c
(gdb-memory-set-address)
(gdb-memory-set-repeat-count): Allow keyboard bindings.
(gdb-memory-mode-map): Bind above functions respectively
to 'S' and 'N'.
author | Nick Roberts <nickrob@snap.net.nz> |
---|---|
date | Mon, 16 Jun 2008 11:26:22 +0000 |
parents | b4e36ff621b3 |
children | cc30416c6de7 |
comparison
equal
deleted
inserted
replaced
96008:8844564f516f | 96009:8e1702dc030c |
---|---|
2718 (setq gdb-memory-address (match-string 0))))) | 2718 (setq gdb-memory-address (match-string 0))))) |
2719 | 2719 |
2720 (defvar gdb-memory-mode-map | 2720 (defvar gdb-memory-mode-map |
2721 (let ((map (make-sparse-keymap))) | 2721 (let ((map (make-sparse-keymap))) |
2722 (suppress-keymap map) | 2722 (suppress-keymap map) |
2723 (define-key map "S" 'gdb-memory-set-address) | |
2724 (define-key map "N" 'gdb-memory-set-repeat-count) | |
2723 (define-key map "q" 'kill-this-buffer) | 2725 (define-key map "q" 'kill-this-buffer) |
2724 map)) | 2726 map)) |
2725 | 2727 |
2726 (defun gdb-memory-set-address (event) | 2728 (defun gdb-memory-set-address (&optional event) |
2727 "Set the start memory address." | 2729 "Set the start memory address." |
2728 (interactive "e") | 2730 (interactive) |
2729 (save-selected-window | 2731 (let ((arg (read-from-minibuffer "Start address: "))) |
2730 (select-window (posn-window (event-start event))) | 2732 (setq gdb-memory-address arg)) |
2731 (let ((arg (read-from-minibuffer "Memory address: "))) | 2733 (gdb-invalidate-memory)) |
2732 (setq gdb-memory-address arg)) | 2734 |
2733 (gdb-invalidate-memory))) | 2735 (defun gdb-memory-set-repeat-count (&optional event) |
2734 | |
2735 (defun gdb-memory-set-repeat-count (event) | |
2736 "Set the number of data items in memory window." | 2736 "Set the number of data items in memory window." |
2737 (interactive "e") | 2737 (interactive) |
2738 (save-selected-window | 2738 (let* ((arg (read-from-minibuffer "Repeat count: ")) |
2739 (select-window (posn-window (event-start event))) | 2739 (count (string-to-number arg))) |
2740 (let* ((arg (read-from-minibuffer "Repeat count: ")) | 2740 (if (<= count 0) |
2741 (count (string-to-number arg))) | 2741 (error "Positive numbers only") |
2742 (if (<= count 0) | 2742 (customize-set-variable 'gdb-memory-repeat-count count) |
2743 (error "Positive numbers only") | 2743 (gdb-invalidate-memory)))) |
2744 (customize-set-variable 'gdb-memory-repeat-count count) | |
2745 (gdb-invalidate-memory))))) | |
2746 | 2744 |
2747 (defun gdb-memory-format-binary () | 2745 (defun gdb-memory-format-binary () |
2748 "Set the display format to binary." | 2746 "Set the display format to binary." |
2749 (interactive) | 2747 (interactive) |
2750 (customize-set-variable 'gdb-memory-format "t") | 2748 (customize-set-variable 'gdb-memory-format "t") |
2888 (buffer-disable-undo) | 2886 (buffer-disable-undo) |
2889 (use-local-map gdb-memory-mode-map) | 2887 (use-local-map gdb-memory-mode-map) |
2890 (setq header-line-format | 2888 (setq header-line-format |
2891 '(:eval | 2889 '(:eval |
2892 (concat | 2890 (concat |
2893 "Read address[" | 2891 "Start address[" |
2894 (propertize | 2892 (propertize |
2895 "-" | 2893 "-" |
2896 'face font-lock-warning-face | 2894 'face font-lock-warning-face |
2897 'help-echo "mouse-1: decrement address" | 2895 'help-echo "mouse-1: decrement address" |
2898 'mouse-face 'mode-line-highlight | 2896 'mouse-face 'mode-line-highlight |
2922 (let ((gdb-memory-address nil)) | 2920 (let ((gdb-memory-address nil)) |
2923 (gdb-invalidate-memory))))) | 2921 (gdb-invalidate-memory))))) |
2924 "]: " | 2922 "]: " |
2925 (propertize gdb-memory-address | 2923 (propertize gdb-memory-address |
2926 'face font-lock-warning-face | 2924 'face font-lock-warning-face |
2927 'help-echo "mouse-1: set memory address" | 2925 'help-echo "mouse-1: set start address" |
2928 'mouse-face 'mode-line-highlight | 2926 'mouse-face 'mode-line-highlight |
2929 'local-map (gdb-make-header-line-mouse-map | 2927 'local-map (gdb-make-header-line-mouse-map |
2930 'mouse-1 | 2928 'mouse-1 |
2931 #'gdb-memory-set-address)) | 2929 #'gdb-memory-set-address)) |
2932 " Repeat Count: " | 2930 " Repeat Count: " |