diff options
| author | Nick Roberts | 2005-11-25 21:34:03 +0000 |
|---|---|---|
| committer | Nick Roberts | 2005-11-25 21:34:03 +0000 |
| commit | be1c9844500d06033d6d40436519dc1ff909c8f3 (patch) | |
| tree | 1ff24de543a6313266713d72b872b4905bf59e5e | |
| parent | 1c5a7258db5480b86016189220f02001cf9bb0f3 (diff) | |
| download | emacs-be1c9844500d06033d6d40436519dc1ff909c8f3.tar.gz emacs-be1c9844500d06033d6d40436519dc1ff909c8f3.zip | |
(gdb-info-breakpoints-custom)
(gdb-mouse-toggle-breakpoint-margin)
(gdb-mouse-toggle-breakpoint-fringe, gdb-threads-select):
Add gdb-server-prefix to keep out of command history.
(gdb-edit-register-value): New function.
(gdb-registers-mode-map): Bind mouse-2 and RET to it.
(gdb-info-registers-custom): Use above map.
| -rw-r--r-- | lisp/progmodes/gdb-ui.el | 46 |
1 files changed, 32 insertions, 14 deletions
diff --git a/lisp/progmodes/gdb-ui.el b/lisp/progmodes/gdb-ui.el index 433252757f5..f89e54da798 100644 --- a/lisp/progmodes/gdb-ui.el +++ b/lisp/progmodes/gdb-ui.el | |||
| @@ -1466,11 +1466,11 @@ static char *magick[] = { | |||
| 1466 | (gdb-put-breakpoint-icon (eq flag ?y) bptno))) | 1466 | (gdb-put-breakpoint-icon (eq flag ?y) bptno))) |
| 1467 | (gdb-enqueue-input | 1467 | (gdb-enqueue-input |
| 1468 | (list | 1468 | (list |
| 1469 | (concat "list " | 1469 | (concat gdb-server-prefix "list " |
| 1470 | (match-string-no-properties 1) ":1\n") | 1470 | (match-string-no-properties 1) ":1\n") |
| 1471 | 'ignore)) | 1471 | 'ignore)) |
| 1472 | (gdb-enqueue-input | 1472 | (gdb-enqueue-input |
| 1473 | (list "info source\n" | 1473 | (list (concat gdb-server-prefix "info source\n") |
| 1474 | `(lambda () (gdb-get-location | 1474 | `(lambda () (gdb-get-location |
| 1475 | ,bptno ,line ,flag)))))))))) | 1475 | ,bptno ,line ,flag)))))))))) |
| 1476 | (end-of-line))))) | 1476 | (end-of-line))))) |
| @@ -1505,7 +1505,7 @@ static char *magick[] = { | |||
| 1505 | (list | 1505 | (list |
| 1506 | (let ((bptno (get-text-property | 1506 | (let ((bptno (get-text-property |
| 1507 | 0 'gdb-bptno (car (posn-string posn))))) | 1507 | 0 'gdb-bptno (car (posn-string posn))))) |
| 1508 | (concat | 1508 | (concat gdb-server-prefix |
| 1509 | (if (get-text-property | 1509 | (if (get-text-property |
| 1510 | 0 'gdb-enabled (car (posn-string posn))) | 1510 | 0 'gdb-enabled (car (posn-string posn))) |
| 1511 | "disable " | 1511 | "disable " |
| @@ -1531,7 +1531,7 @@ static char *magick[] = { | |||
| 1531 | (when (stringp obj) | 1531 | (when (stringp obj) |
| 1532 | (gdb-enqueue-input | 1532 | (gdb-enqueue-input |
| 1533 | (list | 1533 | (list |
| 1534 | (concat | 1534 | (concat gdb-server-prefix |
| 1535 | (if (get-text-property 0 'gdb-enabled obj) | 1535 | (if (get-text-property 0 'gdb-enabled obj) |
| 1536 | "disable " | 1536 | "disable " |
| 1537 | "enable ") | 1537 | "enable ") |
| @@ -1832,7 +1832,8 @@ static char *magick[] = { | |||
| 1832 | (interactive (list last-input-event)) | 1832 | (interactive (list last-input-event)) |
| 1833 | (if event (mouse-set-point event)) | 1833 | (if event (mouse-set-point event)) |
| 1834 | (gdb-enqueue-input | 1834 | (gdb-enqueue-input |
| 1835 | (list (concat "thread " (gdb-get-thread-number) "\n") 'ignore)) | 1835 | (list (concat gdb-server-prefix "thread " |
| 1836 | (gdb-get-thread-number) "\n") 'ignore)) | ||
| 1836 | (gud-display-frame)) | 1837 | (gud-display-frame)) |
| 1837 | 1838 | ||
| 1838 | 1839 | ||
| @@ -1859,19 +1860,36 @@ static char *magick[] = { | |||
| 1859 | (with-current-buffer (gdb-get-buffer 'gdb-registers-buffer) | 1860 | (with-current-buffer (gdb-get-buffer 'gdb-registers-buffer) |
| 1860 | (save-excursion | 1861 | (save-excursion |
| 1861 | (let ((buffer-read-only nil) | 1862 | (let ((buffer-read-only nil) |
| 1862 | bl) | 1863 | start end) |
| 1863 | (goto-char (point-min)) | 1864 | (goto-char (point-min)) |
| 1864 | (while (< (point) (point-max)) | 1865 | (while (< (point) (point-max)) |
| 1865 | (setq bl (line-beginning-position)) | 1866 | (setq start (line-beginning-position)) |
| 1867 | (setq end (line-end-position)) | ||
| 1866 | (when (looking-at "^[^ ]+") | 1868 | (when (looking-at "^[^ ]+") |
| 1867 | (unless (string-equal (match-string 0) "The") | 1869 | (unless (string-equal (match-string 0) "The") |
| 1868 | (put-text-property bl (match-end 0) | 1870 | (put-text-property start (match-end 0) |
| 1869 | 'face font-lock-variable-name-face))) | 1871 | 'face font-lock-variable-name-face) |
| 1872 | (add-text-properties start end | ||
| 1873 | '(help-echo "mouse-2: edit value" | ||
| 1874 | mouse-face highlight)))) | ||
| 1870 | (forward-line 1)))))) | 1875 | (forward-line 1)))))) |
| 1871 | 1876 | ||
| 1877 | (defun gdb-edit-register-value (&optional event) | ||
| 1878 | (interactive (list last-input-event)) | ||
| 1879 | (save-excursion | ||
| 1880 | (if event (mouse-set-point event)) | ||
| 1881 | (beginning-of-line) | ||
| 1882 | (let* ((register (current-word)) | ||
| 1883 | (value (read-string (format "New value (%s): " register)))) | ||
| 1884 | (gdb-enqueue-input | ||
| 1885 | (list (concat gdb-server-prefix "set $" register "=" value "\n") | ||
| 1886 | 'ignore))))) | ||
| 1887 | |||
| 1872 | (defvar gdb-registers-mode-map | 1888 | (defvar gdb-registers-mode-map |
| 1873 | (let ((map (make-sparse-keymap))) | 1889 | (let ((map (make-sparse-keymap))) |
| 1874 | (suppress-keymap map) | 1890 | (suppress-keymap map) |
| 1891 | (define-key map "\r" 'gdb-edit-register-value) | ||
| 1892 | (define-key map [mouse-2] 'gdb-edit-register-value) | ||
| 1875 | (define-key map " " 'toggle-gdb-all-registers) | 1893 | (define-key map " " 'toggle-gdb-all-registers) |
| 1876 | (define-key map "q" 'kill-this-buffer) | 1894 | (define-key map "q" 'kill-this-buffer) |
| 1877 | map)) | 1895 | map)) |
| @@ -1915,9 +1933,9 @@ static char *magick[] = { | |||
| 1915 | (setq gdb-all-registers nil) | 1933 | (setq gdb-all-registers nil) |
| 1916 | (with-current-buffer (gdb-get-buffer 'gdb-registers-buffer) | 1934 | (with-current-buffer (gdb-get-buffer 'gdb-registers-buffer) |
| 1917 | (setq mode-name "Registers:"))) | 1935 | (setq mode-name "Registers:"))) |
| 1918 | (setq gdb-all-registers t) | 1936 | (setq gdb-all-registers t) |
| 1919 | (with-current-buffer (gdb-get-buffer 'gdb-registers-buffer) | 1937 | (with-current-buffer (gdb-get-buffer 'gdb-registers-buffer) |
| 1920 | (setq mode-name "Registers:All"))) | 1938 | (setq mode-name "Registers:All"))) |
| 1921 | (gdb-invalidate-registers)) | 1939 | (gdb-invalidate-registers)) |
| 1922 | 1940 | ||
| 1923 | 1941 | ||
| @@ -2253,13 +2271,13 @@ corresponding to the mode line clicked." | |||
| 2253 | "Keymap to create watch expression of a complex data type local variable.") | 2271 | "Keymap to create watch expression of a complex data type local variable.") |
| 2254 | 2272 | ||
| 2255 | (defconst gdb-struct-string | 2273 | (defconst gdb-struct-string |
| 2256 | (concat (propertize "[struct/union];" | 2274 | (concat (propertize "[struct/union]" |
| 2257 | 'mouse-face 'highlight | 2275 | 'mouse-face 'highlight |
| 2258 | 'help-echo "mouse-2: create watch expression" | 2276 | 'help-echo "mouse-2: create watch expression" |
| 2259 | 'local-map gdb-locals-watch-keymap) "\n")) | 2277 | 'local-map gdb-locals-watch-keymap) "\n")) |
| 2260 | 2278 | ||
| 2261 | (defconst gdb-array-string | 2279 | (defconst gdb-array-string |
| 2262 | (concat " " (propertize "[array];" | 2280 | (concat " " (propertize "[array]" |
| 2263 | 'mouse-face 'highlight | 2281 | 'mouse-face 'highlight |
| 2264 | 'help-echo "mouse-2: create watch expression" | 2282 | 'help-echo "mouse-2: create watch expression" |
| 2265 | 'local-map gdb-locals-watch-keymap) "\n")) | 2283 | 'local-map gdb-locals-watch-keymap) "\n")) |