diff options
| author | Nick Roberts | 2004-04-05 21:45:28 +0000 |
|---|---|---|
| committer | Nick Roberts | 2004-04-05 21:45:28 +0000 |
| commit | 614963bafcd2330ba902754429360d39443bb9bc (patch) | |
| tree | 023c335f348d7aee66ca88df205441bf3e6afe2e | |
| parent | 38e33352d8ff921eb4e141d16badd7d1bf411d74 (diff) | |
| download | emacs-614963bafcd2330ba902754429360d39443bb9bc.tar.gz emacs-614963bafcd2330ba902754429360d39443bb9bc.zip | |
(gdb-use-inferior-io-buffer): New option.
(gdb-ann3, gdb-send, gdb-starting, gdb-stopping)
(gdb-setup-windows): Only use separate IO buffer if required.
| -rw-r--r-- | lisp/progmodes/gdb-ui.el | 41 |
1 files changed, 26 insertions, 15 deletions
diff --git a/lisp/progmodes/gdb-ui.el b/lisp/progmodes/gdb-ui.el index 6fccd500af2..a6a5f2d440f 100644 --- a/lisp/progmodes/gdb-ui.el +++ b/lisp/progmodes/gdb-ui.el | |||
| @@ -28,10 +28,11 @@ | |||
| 28 | ;; This mode acts as a graphical user interface to GDB. You can interact with | 28 | ;; This mode acts as a graphical user interface to GDB. You can interact with |
| 29 | ;; GDB through the GUD buffer in the usual way, but there are also further | 29 | ;; GDB through the GUD buffer in the usual way, but there are also further |
| 30 | ;; buffers which control the execution and describe the state of your program. | 30 | ;; buffers which control the execution and describe the state of your program. |
| 31 | ;; It separates the input/output of your program from that of GDB and displays | 31 | ;; It separates the input/output of your program from that of GDB, if |
| 32 | ;; expressions and their current values in their own buffers. It also uses | 32 | ;; required, and displays expressions and their current values in their own |
| 33 | ;; features of Emacs 21 such as the display margin for breakpoints, and the | 33 | ;; buffers. It also uses features of Emacs 21 such as the display margin for |
| 34 | ;; toolbar (see the GDB Graphical Interface section in the Emacs info manual). | 34 | ;; breakpoints, and the toolbar (see the GDB Graphical Interface section in |
| 35 | ;; the Emacs info manual). | ||
| 35 | 36 | ||
| 36 | ;; Start the debugger with M-x gdba. | 37 | ;; Start the debugger with M-x gdba. |
| 37 | 38 | ||
| @@ -131,6 +132,11 @@ The following interactive lisp functions help control operation : | |||
| 131 | :type 'boolean | 132 | :type 'boolean |
| 132 | :group 'gud) | 133 | :group 'gud) |
| 133 | 134 | ||
| 135 | (defcustom gdb-use-inferior-io-buffer nil | ||
| 136 | "Non-nil means display output from the inferior in a separate buffer." | ||
| 137 | :type 'boolean | ||
| 138 | :group 'gud) | ||
| 139 | |||
| 134 | (defun gdb-ann3 () | 140 | (defun gdb-ann3 () |
| 135 | (setq gdb-debug-log nil) | 141 | (setq gdb-debug-log nil) |
| 136 | (set (make-local-variable 'gud-minor-mode) 'gdba) | 142 | (set (make-local-variable 'gud-minor-mode) 'gdba) |
| @@ -181,7 +187,7 @@ The following interactive lisp functions help control operation : | |||
| 181 | (mapc 'make-local-variable gdb-variables) | 187 | (mapc 'make-local-variable gdb-variables) |
| 182 | (setq gdb-buffer-type 'gdba) | 188 | (setq gdb-buffer-type 'gdba) |
| 183 | ;; | 189 | ;; |
| 184 | (gdb-clear-inferior-io) | 190 | (if gdb-use-inferior-io-buffer (gdb-clear-inferior-io)) |
| 185 | ;; | 191 | ;; |
| 186 | (if (eq window-system 'w32) | 192 | (if (eq window-system 'w32) |
| 187 | (gdb-enqueue-input (list "set new-console off\n" 'ignore))) | 193 | (gdb-enqueue-input (list "set new-console off\n" 'ignore))) |
| @@ -604,7 +610,9 @@ The key should be one of the cars in `gdb-buffer-rules-assoc'." | |||
| 604 | (defun gdb-send (proc string) | 610 | (defun gdb-send (proc string) |
| 605 | "A comint send filter for gdb. | 611 | "A comint send filter for gdb. |
| 606 | This filter may simply queue output for a later time." | 612 | This filter may simply queue output for a later time." |
| 607 | (gdb-enqueue-input (concat string "\n"))) | 613 | (if gud-running |
| 614 | (process-send-string proc (concat string "\n")) | ||
| 615 | (gdb-enqueue-input (concat string "\n")))) | ||
| 608 | 616 | ||
| 609 | ;; Note: Stuff enqueued here will be sent to the next prompt, even if it | 617 | ;; Note: Stuff enqueued here will be sent to the next prompt, even if it |
| 610 | ;; is a query, or other non-top-level prompt. | 618 | ;; is a query, or other non-top-level prompt. |
| @@ -742,17 +750,19 @@ subprocess is now the program being debugged, not GDB." | |||
| 742 | ((eq sink 'user) | 750 | ((eq sink 'user) |
| 743 | (progn | 751 | (progn |
| 744 | (setq gud-running t) | 752 | (setq gud-running t) |
| 745 | (gdb-set-output-sink 'inferior))) | 753 | (if gdb-use-inferior-io-buffer |
| 754 | (gdb-set-output-sink 'inferior)))) | ||
| 746 | (t (error "Unexpected `starting' annotation"))))) | 755 | (t (error "Unexpected `starting' annotation"))))) |
| 747 | 756 | ||
| 748 | (defun gdb-stopping (ignored) | 757 | (defun gdb-stopping (ignored) |
| 749 | "An annotation handler for `exited' and other annotations which say that I/O | 758 | "An annotation handler for `exited' and other annotations which say that I/O |
| 750 | for the subprocess is now GDB, not the program being debugged." | 759 | for the subprocess is now GDB, not the program being debugged." |
| 751 | (let ((sink (gdb-get-output-sink))) | 760 | (if gdb-use-inferior-io-buffer |
| 752 | (cond | 761 | (let ((sink (gdb-get-output-sink))) |
| 753 | ((eq sink 'inferior) | 762 | (cond |
| 754 | (gdb-set-output-sink 'user)) | 763 | ((eq sink 'inferior) |
| 755 | (t (error "Unexpected stopping annotation"))))) | 764 | (gdb-set-output-sink 'user)) |
| 765 | (t (error "Unexpected stopping annotation")))))) | ||
| 756 | 766 | ||
| 757 | (defun gdb-frame-begin (ignored) | 767 | (defun gdb-frame-begin (ignored) |
| 758 | (let ((sink (gdb-get-output-sink))) | 768 | (let ((sink (gdb-get-output-sink))) |
| @@ -1657,9 +1667,10 @@ the source buffer." | |||
| 1657 | (gud-find-file gdb-main-file)) | 1667 | (gud-find-file gdb-main-file)) |
| 1658 | (gdb-get-create-buffer 'gdb-assembler-buffer))) | 1668 | (gdb-get-create-buffer 'gdb-assembler-buffer))) |
| 1659 | (setq gdb-source-window (get-buffer-window (current-buffer))) | 1669 | (setq gdb-source-window (get-buffer-window (current-buffer))) |
| 1660 | (split-window-horizontally) | 1670 | (when gdb-use-inferior-io-buffer |
| 1661 | (other-window 1) | 1671 | (split-window-horizontally) |
| 1662 | (switch-to-buffer (gdb-inferior-io-name)) | 1672 | (other-window 1) |
| 1673 | (switch-to-buffer (gdb-inferior-io-name))) | ||
| 1663 | (other-window 1) | 1674 | (other-window 1) |
| 1664 | (switch-to-buffer (gdb-stack-buffer-name)) | 1675 | (switch-to-buffer (gdb-stack-buffer-name)) |
| 1665 | (split-window-horizontally) | 1676 | (split-window-horizontally) |