diff options
| author | Nick Roberts | 2009-08-28 10:56:13 +0000 |
|---|---|---|
| committer | Nick Roberts | 2009-08-28 10:56:13 +0000 |
| commit | 7e3242e4fc8819ece649aeac9a6db169ddd8f7be (patch) | |
| tree | 1175359e086ce47f63f14e196541258b299379f2 | |
| parent | 3f0c2b9205867d95ac3ca4faf819a2a08237556c (diff) | |
| download | emacs-7e3242e4fc8819ece649aeac9a6db169ddd8f7be.tar.gz emacs-7e3242e4fc8819ece649aeac9a6db169ddd8f7be.zip | |
(gdb-use-separate-io-buffer): Remove
variable ...
(gdb-init-1, gdb-display-separate-io-buffer)
(gdb-frame-separate-io-buffer, gdb-setup-windows): ... and
references to it.
(gdb-inferior-io-mode): Use make-comint-in-buffer.
(gdb-inferior-filter): Use comint-output-filter to stop
echoing and remove ^M characters.
| -rw-r--r-- | lisp/progmodes/gdb-mi.el | 61 |
1 files changed, 29 insertions, 32 deletions
diff --git a/lisp/progmodes/gdb-mi.el b/lisp/progmodes/gdb-mi.el index b5617bb2ab2..c05c972743e 100644 --- a/lisp/progmodes/gdb-mi.el +++ b/lisp/progmodes/gdb-mi.el | |||
| @@ -498,9 +498,6 @@ Also display the main routine in the disassembly buffer if present." | |||
| 498 | :group 'gdb | 498 | :group 'gdb |
| 499 | :version "22.1") | 499 | :version "22.1") |
| 500 | 500 | ||
| 501 | ; Note: This mode requires a separate buffer for inferior IO. | ||
| 502 | (defconst gdb-use-separate-io-buffer t) | ||
| 503 | |||
| 504 | (defun gdb-force-mode-line-update (status) | 501 | (defun gdb-force-mode-line-update (status) |
| 505 | (let ((buffer gud-comint-buffer)) | 502 | (let ((buffer gud-comint-buffer)) |
| 506 | (if (and buffer (buffer-name buffer)) | 503 | (if (and buffer (buffer-name buffer)) |
| @@ -792,15 +789,15 @@ detailed description of this mode. | |||
| 792 | ;; | 789 | ;; |
| 793 | (gdb-force-mode-line-update | 790 | (gdb-force-mode-line-update |
| 794 | (propertize "initializing..." 'face font-lock-variable-name-face)) | 791 | (propertize "initializing..." 'face font-lock-variable-name-face)) |
| 795 | (when gdb-use-separate-io-buffer | 792 | |
| 796 | (gdb-get-buffer-create 'gdb-inferior-io) | 793 | (gdb-get-buffer-create 'gdb-inferior-io) |
| 797 | (gdb-clear-inferior-io) | 794 | (gdb-clear-inferior-io) |
| 798 | (set-process-filter (get-process "gdb-inferior") 'gdb-inferior-filter) | 795 | (set-process-filter (get-process "gdb-inferior") 'gdb-inferior-filter) |
| 799 | (gdb-input | 796 | (gdb-input |
| 800 | ;; Needs GDB 6.4 onwards | 797 | ;; Needs GDB 6.4 onwards |
| 801 | (list (concat "-inferior-tty-set " | 798 | (list (concat "-inferior-tty-set " |
| 802 | (process-tty-name (get-process "gdb-inferior"))) | 799 | (process-tty-name (get-process "gdb-inferior"))) |
| 803 | 'ignore))) | 800 | 'ignore)) |
| 804 | (if (eq window-system 'w32) | 801 | (if (eq window-system 'w32) |
| 805 | (gdb-input (list "-gdb-set new-console off" 'ignore))) | 802 | (gdb-input (list "-gdb-set new-console off" 'ignore))) |
| 806 | (gdb-input (list "-gdb-set height 0" 'ignore)) | 803 | (gdb-input (list "-gdb-set height 0" 'ignore)) |
| @@ -1325,7 +1322,8 @@ DOC is an optional documentation string." | |||
| 1325 | (gdb-get-buffer-create ,buffer thread) t))) | 1322 | (gdb-get-buffer-create ,buffer thread) t))) |
| 1326 | 1323 | ||
| 1327 | ;; Used to display windows with thread-bound buffers | 1324 | ;; Used to display windows with thread-bound buffers |
| 1328 | (defmacro def-gdb-preempt-display-buffer (name buffer &optional doc split-horizontal) | 1325 | (defmacro def-gdb-preempt-display-buffer (name buffer &optional doc |
| 1326 | split-horizontal) | ||
| 1329 | `(defun ,name (&optional thread) | 1327 | `(defun ,name (&optional thread) |
| 1330 | ,(when doc doc) | 1328 | ,(when doc doc) |
| 1331 | (message thread) | 1329 | (message thread) |
| @@ -1401,9 +1399,8 @@ DOC is an optional documentation string." | |||
| 1401 | (defun gdb-display-separate-io-buffer () | 1399 | (defun gdb-display-separate-io-buffer () |
| 1402 | "Display IO of debugged program in a separate window." | 1400 | "Display IO of debugged program in a separate window." |
| 1403 | (interactive) | 1401 | (interactive) |
| 1404 | (if gdb-use-separate-io-buffer | 1402 | (gdb-display-buffer |
| 1405 | (gdb-display-buffer | 1403 | (gdb-get-buffer-create 'gdb-inferior-io) t)) |
| 1406 | (gdb-get-buffer-create 'gdb-inferior-io) t))) | ||
| 1407 | 1404 | ||
| 1408 | (defconst gdb-frame-parameters | 1405 | (defconst gdb-frame-parameters |
| 1409 | '((height . 14) (width . 80) | 1406 | '((height . 14) (width . 80) |
| @@ -1415,10 +1412,9 @@ DOC is an optional documentation string." | |||
| 1415 | (defun gdb-frame-separate-io-buffer () | 1412 | (defun gdb-frame-separate-io-buffer () |
| 1416 | "Display IO of debugged program in a new frame." | 1413 | "Display IO of debugged program in a new frame." |
| 1417 | (interactive) | 1414 | (interactive) |
| 1418 | (if gdb-use-separate-io-buffer | 1415 | (let ((special-display-regexps (append special-display-regexps '(".*"))) |
| 1419 | (let ((special-display-regexps (append special-display-regexps '(".*"))) | 1416 | (special-display-frame-alist gdb-frame-parameters)) |
| 1420 | (special-display-frame-alist gdb-frame-parameters)) | 1417 | (display-buffer (gdb-get-buffer-create 'gdb-inferior-io)))) |
| 1421 | (display-buffer (gdb-get-buffer-create 'gdb-inferior-io))))) | ||
| 1422 | 1418 | ||
| 1423 | (defvar gdb-inferior-io-mode-map | 1419 | (defvar gdb-inferior-io-mode-map |
| 1424 | (let ((map (make-sparse-keymap))) | 1420 | (let ((map (make-sparse-keymap))) |
| @@ -1429,20 +1425,22 @@ DOC is an optional documentation string." | |||
| 1429 | (define-key map "\C-d" 'gdb-separate-io-eof) | 1425 | (define-key map "\C-d" 'gdb-separate-io-eof) |
| 1430 | map)) | 1426 | map)) |
| 1431 | 1427 | ||
| 1428 | ;; We want to use comint because it has various nifty and familiar features. | ||
| 1432 | (define-derived-mode gdb-inferior-io-mode comint-mode "Inferior I/O" | 1429 | (define-derived-mode gdb-inferior-io-mode comint-mode "Inferior I/O" |
| 1433 | "Major mode for gdb inferior-io." | 1430 | "Major mode for gdb inferior-io. |
| 1431 | |||
| 1432 | The following commands are available: | ||
| 1433 | \\{gdb-inferior-io-mode-map}" | ||
| 1434 | |||
| 1434 | :syntax-table nil :abbrev-table nil | 1435 | :syntax-table nil :abbrev-table nil |
| 1435 | ;; We want to use comint because it has various nifty and familiar features. | 1436 | |
| 1436 | (start-process "gdb-inferior" | 1437 | (make-comint-in-buffer "gdb-inferior" (current-buffer) nil)) |
| 1437 | ;; (concat "*input/output of " (gdb-get-target-string) "*") | ||
| 1438 | (current-buffer) | ||
| 1439 | nil)) | ||
| 1440 | 1438 | ||
| 1441 | (defun gdb-inferior-filter (proc string) | 1439 | (defun gdb-inferior-filter (proc string) |
| 1442 | (unless (string-equal string "") | 1440 | (unless (string-equal string "") |
| 1443 | (gdb-display-buffer (gdb-get-buffer-create 'gdb-inferior-io) t)) | 1441 | (gdb-display-buffer (gdb-get-buffer-create 'gdb-inferior-io) t)) |
| 1444 | (with-current-buffer (gdb-get-buffer-create 'gdb-inferior-io) | 1442 | (with-current-buffer (gdb-get-buffer-create 'gdb-inferior-io) |
| 1445 | (insert-before-markers string))) | 1443 | (comint-output-filter proc string))) |
| 1446 | 1444 | ||
| 1447 | (defun gdb-separate-io-interrupt () | 1445 | (defun gdb-separate-io-interrupt () |
| 1448 | "Interrupt the program being debugged." | 1446 | "Interrupt the program being debugged." |
| @@ -3949,11 +3947,10 @@ window is dedicated." | |||
| 3949 | ;; can't find a source file. | 3947 | ;; can't find a source file. |
| 3950 | (list-buffers-noselect)))) | 3948 | (list-buffers-noselect)))) |
| 3951 | (setq gdb-source-window (selected-window)) | 3949 | (setq gdb-source-window (selected-window)) |
| 3952 | (when gdb-use-separate-io-buffer | 3950 | (split-window-horizontally) |
| 3953 | (split-window-horizontally) | 3951 | (other-window 1) |
| 3954 | (other-window 1) | 3952 | (gdb-set-window-buffer |
| 3955 | (gdb-set-window-buffer | 3953 | (gdb-get-buffer-create 'gdb-inferior-io)) |
| 3956 | (gdb-get-buffer-create 'gdb-inferior-io))) | ||
| 3957 | (other-window 1) | 3954 | (other-window 1) |
| 3958 | (gdb-set-window-buffer (gdb-stack-buffer-name)) | 3955 | (gdb-set-window-buffer (gdb-stack-buffer-name)) |
| 3959 | (split-window-horizontally) | 3956 | (split-window-horizontally) |