summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChong Yidong <cyd@gnu.org>2012-04-20 15:13:25 +0800
committerChong Yidong <cyd@gnu.org>2012-04-20 15:13:25 +0800
commit8912063b467877f8f30751e1b0077791805cbcea (patch)
treea54ae135322f215a5b3c60e090ab882218ba2029
parentf30d612a7a628828baa7c333629a10295605291b (diff)
downloademacs-8912063b467877f8f30751e1b0077791805cbcea.tar.gz
Fix last change.
* lisp/progmodes/gdb-mi.el (gdb-inferior-io-sentinel): Don't do anything if gdb process is killed.
-rw-r--r--lisp/progmodes/gdb-mi.el16
1 files changed, 10 insertions, 6 deletions
diff --git a/lisp/progmodes/gdb-mi.el b/lisp/progmodes/gdb-mi.el
index 455727f9e02..f2d8f1f75b7 100644
--- a/lisp/progmodes/gdb-mi.el
+++ b/lisp/progmodes/gdb-mi.el
@@ -1536,12 +1536,16 @@ DOC is an optional documentation string."
(defun gdb-inferior-io-sentinel (proc str)
(when (eq (process-status proc) 'failed)
;; When the debugged process exits, Emacs gets an EIO error on
- ;; read from the pty, and stops listening to it. Remove the pty,
- ;; make a new one, and pass it to gdb.
- (let ((buffer (process-buffer proc)))
- ;; `comint-exec' deletes the original process as a side effect.
- (comint-exec buffer "gdb-inferior" nil nil nil)
- (gdb-inferior-io--init-proc (get-buffer-process buffer)))))
+ ;; read from the pty, and stops listening to it. If the gdb
+ ;; process is still running, remove the pty, make a new one, and
+ ;; pass it to gdb.
+ (let ((gdb-proc (get-buffer-process gud-comint-buffer))
+ (io-buffer (process-buffer proc)))
+ (when (and gdb-proc (process-live-p gdb-proc)
+ (buffer-live-p io-buffer))
+ ;; `comint-exec' deletes the original process as a side effect.
+ (comint-exec io-buffer "gdb-inferior" nil nil nil)
+ (gdb-inferior-io--init-proc (get-buffer-process io-buffer))))))
(defconst gdb-frame-parameters
'((height . 14) (width . 80)