diff options
| author | Nick Roberts | 2005-05-29 10:48:29 +0000 |
|---|---|---|
| committer | Nick Roberts | 2005-05-29 10:48:29 +0000 |
| commit | 1f1f4de2dac71b48495ba00425022f8d5f52e7bf (patch) | |
| tree | 40194aaa7aff1b36ca94e38ff6ca91f769a1042d | |
| parent | 8c6fb9d004c0ae9f48fa405712645386854a2256 (diff) | |
| download | emacs-1f1f4de2dac71b48495ba00425022f8d5f52e7bf.tar.gz emacs-1f1f4de2dac71b48495ba00425022f8d5f52e7bf.zip | |
(gdb-memory-set-repeat-count):
Throw error when count <= 0 to ensure input is a number.
(gdb-read-memory-custom): Pick up address from buffer.
(gdb-memory-mode): Allow user to increment and decrement
memory address from header line.
| -rw-r--r-- | lisp/progmodes/gdb-ui.el | 43 |
1 files changed, 39 insertions, 4 deletions
diff --git a/lisp/progmodes/gdb-ui.el b/lisp/progmodes/gdb-ui.el index df9d455f7df..54778b7b89c 100644 --- a/lisp/progmodes/gdb-ui.el +++ b/lisp/progmodes/gdb-ui.el | |||
| @@ -1766,7 +1766,11 @@ static char *magick[] = { | |||
| 1766 | gdb-read-memory-handler | 1766 | gdb-read-memory-handler |
| 1767 | gdb-read-memory-custom) | 1767 | gdb-read-memory-custom) |
| 1768 | 1768 | ||
| 1769 | (defun gdb-read-memory-custom ()) | 1769 | (defun gdb-read-memory-custom () |
| 1770 | (save-excursion | ||
| 1771 | (goto-char (point-min)) | ||
| 1772 | (if (looking-at "0x[[:xdigit:]]+") | ||
| 1773 | (setq gdb-memory-address (match-string 0))))) | ||
| 1770 | 1774 | ||
| 1771 | (defvar gdb-memory-mode-map | 1775 | (defvar gdb-memory-mode-map |
| 1772 | (let ((map (make-sparse-keymap))) | 1776 | (let ((map (make-sparse-keymap))) |
| @@ -1790,8 +1794,8 @@ static char *magick[] = { | |||
| 1790 | (select-window (posn-window (event-start event))) | 1794 | (select-window (posn-window (event-start event))) |
| 1791 | (let* ((arg (read-from-minibuffer "Repeat count: ")) | 1795 | (let* ((arg (read-from-minibuffer "Repeat count: ")) |
| 1792 | (count (string-to-number arg))) | 1796 | (count (string-to-number arg))) |
| 1793 | (if (< count 0) | 1797 | (if (<= count 0) |
| 1794 | (error "Non-negative numbers only") | 1798 | (error "Positive numbers only") |
| 1795 | (customize-set-variable 'gdb-memory-repeat-count count) | 1799 | (customize-set-variable 'gdb-memory-repeat-count count) |
| 1796 | (gdb-invalidate-memory))))) | 1800 | (gdb-invalidate-memory))))) |
| 1797 | 1801 | ||
| @@ -1944,7 +1948,38 @@ corresponding to the mode line clicked." | |||
| 1944 | (setq header-line-format | 1948 | (setq header-line-format |
| 1945 | '(:eval | 1949 | '(:eval |
| 1946 | (concat | 1950 | (concat |
| 1947 | "Read address: " | 1951 | "Read address[" |
| 1952 | (propertize | ||
| 1953 | "-" | ||
| 1954 | 'face font-lock-warning-face | ||
| 1955 | 'help-echo "mouse-1: Decrement address" | ||
| 1956 | 'mouse-face 'mode-line-highlight | ||
| 1957 | 'local-map | ||
| 1958 | (gdb-make-header-line-mouse-map | ||
| 1959 | 'mouse-1 | ||
| 1960 | #'(lambda () (interactive) | ||
| 1961 | (let ((gdb-memory-address | ||
| 1962 | ;; let GDB do the arithmetic | ||
| 1963 | (concat | ||
| 1964 | gdb-memory-address " - " | ||
| 1965 | (number-to-string | ||
| 1966 | (* gdb-memory-repeat-count | ||
| 1967 | (cond ((string= gdb-memory-unit "b") 1) | ||
| 1968 | ((string= gdb-memory-unit "h") 2) | ||
| 1969 | ((string= gdb-memory-unit "w") 4) | ||
| 1970 | ((string= gdb-memory-unit "g") 8))))))) | ||
| 1971 | (gdb-invalidate-memory))))) | ||
| 1972 | "|" | ||
| 1973 | (propertize "+" | ||
| 1974 | 'face font-lock-warning-face | ||
| 1975 | 'help-echo "mouse-1: Increment address" | ||
| 1976 | 'mouse-face 'mode-line-highlight | ||
| 1977 | 'local-map (gdb-make-header-line-mouse-map | ||
| 1978 | 'mouse-1 | ||
| 1979 | #'(lambda () (interactive) | ||
| 1980 | (let ((gdb-memory-address nil)) | ||
| 1981 | (gdb-invalidate-memory))))) | ||
| 1982 | "]: " | ||
| 1948 | (propertize gdb-memory-address | 1983 | (propertize gdb-memory-address |
| 1949 | 'face font-lock-warning-face | 1984 | 'face font-lock-warning-face |
| 1950 | 'help-echo "mouse-1: Set memory address" | 1985 | 'help-echo "mouse-1: Set memory address" |