From: Manuel Giraud Date: Mon, 5 Dec 2022 16:48:15 +0000 (+0100) Subject: Fix GDB save history (bug#59838) X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=0878279809c8acc8de703ae9774e89695b4ffc37;p=emacs.git Fix GDB save history (bug#59838) * lisp/progmodes/gdb-mi.el (gdb-reset): Save GDB comint history. (gdb-delchar-or-quit): Remove useless progn and add comment. --- diff --git a/lisp/progmodes/gdb-mi.el b/lisp/progmodes/gdb-mi.el index 9cbee50ce31..eb0e5b0481c 100644 --- a/lisp/progmodes/gdb-mi.el +++ b/lisp/progmodes/gdb-mi.el @@ -1113,13 +1113,13 @@ no input, and GDB is waiting for input." (process-live-p proc) (not gud-running) (= (point) (marker-position (process-mark proc)))) - ;; Sending an EOF does not work with GDB-MI; submit an - ;; explicit quit command. - (progn - (if (> gdb-control-level 0) - (process-send-eof proc) - (insert "quit") - (comint-send-input t t))) + ;; Exit a recursive reading loop or quit. + (if (> gdb-control-level 0) + (process-send-eof proc) + ;; Sending an EOF does not work with GDB-MI; submit an + ;; explicit quit command. + (insert "quit") + (comint-send-input t t)) (delete-char arg)))) (defvar gdb-define-alist nil "Alist of #define directives for GUD tooltips.") @@ -5157,6 +5157,8 @@ This arrangement depends on the values of variable (defun gdb-reset () "Exit a debugging session cleanly. Kills the gdb buffers, and resets variables and the source buffers." + ;; Save GDB history + (comint-write-input-ring) ;; The gdb-inferior buffer has a pty hooked up to the main gdb ;; process. This pty must be deleted explicitly. (let ((pty (get-process "gdb-inferior")))