mirror of
https://git.savannah.gnu.org/git/emacs.git
synced 2024-11-24 07:20:37 +00:00
(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.
This commit is contained in:
parent
38e33352d8
commit
614963bafc
@ -28,10 +28,11 @@
|
|||||||
;; This mode acts as a graphical user interface to GDB. You can interact with
|
;; This mode acts as a graphical user interface to GDB. You can interact with
|
||||||
;; GDB through the GUD buffer in the usual way, but there are also further
|
;; GDB through the GUD buffer in the usual way, but there are also further
|
||||||
;; buffers which control the execution and describe the state of your program.
|
;; buffers which control the execution and describe the state of your program.
|
||||||
;; It separates the input/output of your program from that of GDB and displays
|
;; It separates the input/output of your program from that of GDB, if
|
||||||
;; expressions and their current values in their own buffers. It also uses
|
;; required, and displays expressions and their current values in their own
|
||||||
;; features of Emacs 21 such as the display margin for breakpoints, and the
|
;; buffers. It also uses features of Emacs 21 such as the display margin for
|
||||||
;; toolbar (see the GDB Graphical Interface section in the Emacs info manual).
|
;; breakpoints, and the toolbar (see the GDB Graphical Interface section in
|
||||||
|
;; the Emacs info manual).
|
||||||
|
|
||||||
;; Start the debugger with M-x gdba.
|
;; Start the debugger with M-x gdba.
|
||||||
|
|
||||||
@ -131,6 +132,11 @@ The following interactive lisp functions help control operation :
|
|||||||
:type 'boolean
|
:type 'boolean
|
||||||
:group 'gud)
|
:group 'gud)
|
||||||
|
|
||||||
|
(defcustom gdb-use-inferior-io-buffer nil
|
||||||
|
"Non-nil means display output from the inferior in a separate buffer."
|
||||||
|
:type 'boolean
|
||||||
|
:group 'gud)
|
||||||
|
|
||||||
(defun gdb-ann3 ()
|
(defun gdb-ann3 ()
|
||||||
(setq gdb-debug-log nil)
|
(setq gdb-debug-log nil)
|
||||||
(set (make-local-variable 'gud-minor-mode) 'gdba)
|
(set (make-local-variable 'gud-minor-mode) 'gdba)
|
||||||
@ -181,7 +187,7 @@ The following interactive lisp functions help control operation :
|
|||||||
(mapc 'make-local-variable gdb-variables)
|
(mapc 'make-local-variable gdb-variables)
|
||||||
(setq gdb-buffer-type 'gdba)
|
(setq gdb-buffer-type 'gdba)
|
||||||
;;
|
;;
|
||||||
(gdb-clear-inferior-io)
|
(if gdb-use-inferior-io-buffer (gdb-clear-inferior-io))
|
||||||
;;
|
;;
|
||||||
(if (eq window-system 'w32)
|
(if (eq window-system 'w32)
|
||||||
(gdb-enqueue-input (list "set new-console off\n" 'ignore)))
|
(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'."
|
|||||||
(defun gdb-send (proc string)
|
(defun gdb-send (proc string)
|
||||||
"A comint send filter for gdb.
|
"A comint send filter for gdb.
|
||||||
This filter may simply queue output for a later time."
|
This filter may simply queue output for a later time."
|
||||||
(gdb-enqueue-input (concat string "\n")))
|
(if gud-running
|
||||||
|
(process-send-string proc (concat string "\n"))
|
||||||
|
(gdb-enqueue-input (concat string "\n"))))
|
||||||
|
|
||||||
;; Note: Stuff enqueued here will be sent to the next prompt, even if it
|
;; Note: Stuff enqueued here will be sent to the next prompt, even if it
|
||||||
;; is a query, or other non-top-level prompt.
|
;; is a query, or other non-top-level prompt.
|
||||||
@ -742,17 +750,19 @@ subprocess is now the program being debugged, not GDB."
|
|||||||
((eq sink 'user)
|
((eq sink 'user)
|
||||||
(progn
|
(progn
|
||||||
(setq gud-running t)
|
(setq gud-running t)
|
||||||
(gdb-set-output-sink 'inferior)))
|
(if gdb-use-inferior-io-buffer
|
||||||
|
(gdb-set-output-sink 'inferior))))
|
||||||
(t (error "Unexpected `starting' annotation")))))
|
(t (error "Unexpected `starting' annotation")))))
|
||||||
|
|
||||||
(defun gdb-stopping (ignored)
|
(defun gdb-stopping (ignored)
|
||||||
"An annotation handler for `exited' and other annotations which say that I/O
|
"An annotation handler for `exited' and other annotations which say that I/O
|
||||||
for the subprocess is now GDB, not the program being debugged."
|
for the subprocess is now GDB, not the program being debugged."
|
||||||
(let ((sink (gdb-get-output-sink)))
|
(if gdb-use-inferior-io-buffer
|
||||||
(cond
|
(let ((sink (gdb-get-output-sink)))
|
||||||
((eq sink 'inferior)
|
(cond
|
||||||
(gdb-set-output-sink 'user))
|
((eq sink 'inferior)
|
||||||
(t (error "Unexpected stopping annotation")))))
|
(gdb-set-output-sink 'user))
|
||||||
|
(t (error "Unexpected stopping annotation"))))))
|
||||||
|
|
||||||
(defun gdb-frame-begin (ignored)
|
(defun gdb-frame-begin (ignored)
|
||||||
(let ((sink (gdb-get-output-sink)))
|
(let ((sink (gdb-get-output-sink)))
|
||||||
@ -1657,9 +1667,10 @@ the source buffer."
|
|||||||
(gud-find-file gdb-main-file))
|
(gud-find-file gdb-main-file))
|
||||||
(gdb-get-create-buffer 'gdb-assembler-buffer)))
|
(gdb-get-create-buffer 'gdb-assembler-buffer)))
|
||||||
(setq gdb-source-window (get-buffer-window (current-buffer)))
|
(setq gdb-source-window (get-buffer-window (current-buffer)))
|
||||||
(split-window-horizontally)
|
(when gdb-use-inferior-io-buffer
|
||||||
(other-window 1)
|
(split-window-horizontally)
|
||||||
(switch-to-buffer (gdb-inferior-io-name))
|
(other-window 1)
|
||||||
|
(switch-to-buffer (gdb-inferior-io-name)))
|
||||||
(other-window 1)
|
(other-window 1)
|
||||||
(switch-to-buffer (gdb-stack-buffer-name))
|
(switch-to-buffer (gdb-stack-buffer-name))
|
||||||
(split-window-horizontally)
|
(split-window-horizontally)
|
||||||
|
Loading…
Reference in New Issue
Block a user