From baceb8e84d350bd8f981ff8289381ec55887c970 Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Fri, 31 Jan 2020 11:34:50 +0200 Subject: [PATCH] Allow exiting the Python interpreter of a GDB session * lisp/progmodes/gdb-mi.el (gdb-delchar-or-quit): Send EOF to GDB if we are in an embedded interpreter. This allows to exit from "pi" cleanly. (Bug#39140) --- lisp/progmodes/gdb-mi.el | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lisp/progmodes/gdb-mi.el b/lisp/progmodes/gdb-mi.el index e4233dacaf6..2978d4a7672 100644 --- a/lisp/progmodes/gdb-mi.el +++ b/lisp/progmodes/gdb-mi.el @@ -1001,8 +1001,10 @@ no input, and GDB is waiting for input." ;; Sending an EOF does not work with GDB-MI; submit an ;; explicit quit command. (progn - (insert "quit") - (comint-send-input t t)) + (if (> gdb-control-level 0) + (process-send-eof proc) + (insert "quit") + (comint-send-input t t))) (delete-char arg)))) (defvar gdb-define-alist nil "Alist of #define directives for GUD tooltips.") -- 2.39.2