diff options
| author | Nick Roberts | 2006-04-26 23:03:56 +0000 |
|---|---|---|
| committer | Nick Roberts | 2006-04-26 23:03:56 +0000 |
| commit | e3456652af4eb1f2a567791bc8df0634ebf3fe49 (patch) | |
| tree | 067df94cd0cca78085f77cceda82809ef94230c7 | |
| parent | 5cd35d2cf0ff1d78ba48e7c1a67efa8f1afdbefe (diff) | |
| download | emacs-e3456652af4eb1f2a567791bc8df0634ebf3fe49.tar.gz emacs-e3456652af4eb1f2a567791bc8df0634ebf3fe49.zip | |
(gud-comint-buffer): Move forward to stop byte compiler warnings.
(gud-basic-call, gud-find-expr): Let user select an expression
for printing. Print expression as well as value in GUD buffer.
| -rw-r--r-- | lisp/progmodes/gud.el | 27 |
1 files changed, 22 insertions, 5 deletions
diff --git a/lisp/progmodes/gud.el b/lisp/progmodes/gud.el index e1e2b9e28cd..1549150dfa8 100644 --- a/lisp/progmodes/gud.el +++ b/lisp/progmodes/gud.el | |||
| @@ -83,6 +83,8 @@ Supported debuggers include gdb, sdb, dbx, xdb, perldb, pdb (Python), jdb, and b | |||
| 83 | (defvar gud-minor-mode nil) | 83 | (defvar gud-minor-mode nil) |
| 84 | (put 'gud-minor-mode 'permanent-local t) | 84 | (put 'gud-minor-mode 'permanent-local t) |
| 85 | 85 | ||
| 86 | (defvar gud-comint-buffer nil) | ||
| 87 | |||
| 86 | (defvar gud-keep-buffer nil) | 88 | (defvar gud-keep-buffer nil) |
| 87 | 89 | ||
| 88 | (defun gud-symbol (sym &optional soft minor-mode) | 90 | (defun gud-symbol (sym &optional soft minor-mode) |
| @@ -740,8 +742,6 @@ To run GDB in text command mode, set `gud-gdb-command-name' to | |||
| 740 | ;; The completion list is constructed by the process filter. | 742 | ;; The completion list is constructed by the process filter. |
| 741 | (defvar gud-gdb-fetched-lines) | 743 | (defvar gud-gdb-fetched-lines) |
| 742 | 744 | ||
| 743 | (defvar gud-comint-buffer nil) | ||
| 744 | |||
| 745 | (defun gud-gdb-complete-command (&optional command a b) | 745 | (defun gud-gdb-complete-command (&optional command a b) |
| 746 | "Perform completion on the GDB command preceding point. | 746 | "Perform completion on the GDB command preceding point. |
| 747 | This is implemented using the GDB `complete' command which isn't | 747 | This is implemented using the GDB `complete' command which isn't |
| @@ -2889,8 +2889,11 @@ Obeying it means displaying in another window the specified file and line." | |||
| 2889 | (set-buffer gud-comint-buffer) | 2889 | (set-buffer gud-comint-buffer) |
| 2890 | (save-restriction | 2890 | (save-restriction |
| 2891 | (widen) | 2891 | (widen) |
| 2892 | (goto-char (process-mark proc)) | 2892 | (if (marker-position gud-delete-prompt-marker) |
| 2893 | (forward-line 0) | 2893 | ;; We get here when printing an expression. |
| 2894 | (goto-char gud-delete-prompt-marker) | ||
| 2895 | (goto-char (process-mark proc)) | ||
| 2896 | (forward-line 0)) | ||
| 2894 | (if (looking-at comint-prompt-regexp) | 2897 | (if (looking-at comint-prompt-regexp) |
| 2895 | (set-marker gud-delete-prompt-marker (point))) | 2898 | (set-marker gud-delete-prompt-marker (point))) |
| 2896 | (if (memq gud-minor-mode '(gdbmi gdba)) | 2899 | (if (memq gud-minor-mode '(gdbmi gdba)) |
| @@ -2911,7 +2914,21 @@ Obeying it means displaying in another window the specified file and line." | |||
| 2911 | (defvar gud-find-expr-function 'gud-find-c-expr) | 2914 | (defvar gud-find-expr-function 'gud-find-c-expr) |
| 2912 | 2915 | ||
| 2913 | (defun gud-find-expr (&rest args) | 2916 | (defun gud-find-expr (&rest args) |
| 2914 | (apply gud-find-expr-function args)) | 2917 | (let ((expr (if (and transient-mark-mode mark-active) |
| 2918 | (buffer-substring (region-beginning) (region-end)) | ||
| 2919 | (apply gud-find-expr-function args)))) | ||
| 2920 | (save-match-data | ||
| 2921 | (if (string-match "\n" expr) | ||
| 2922 | (error "Expression must not include a newline")) | ||
| 2923 | (with-current-buffer gud-comint-buffer | ||
| 2924 | (save-excursion | ||
| 2925 | (goto-char (process-mark (get-buffer-process gud-comint-buffer))) | ||
| 2926 | (forward-line 0) | ||
| 2927 | (when (looking-at comint-prompt-regexp) | ||
| 2928 | (set-marker gud-delete-prompt-marker (point)) | ||
| 2929 | (set-marker-insertion-type gud-delete-prompt-marker t)) | ||
| 2930 | (insert (concat expr " = "))))) | ||
| 2931 | expr)) | ||
| 2915 | 2932 | ||
| 2916 | ;; The next eight functions are hacked from gdbsrc.el by | 2933 | ;; The next eight functions are hacked from gdbsrc.el by |
| 2917 | ;; Debby Ayers <ayers@asc.slb.com>, | 2934 | ;; Debby Ayers <ayers@asc.slb.com>, |