From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Manuel Giraud Newsgroups: gmane.emacs.bugs Subject: bug#59838: 30.0.50; [PATCH] Save history in GDB session Date: Fri, 09 Dec 2022 10:02:40 +0100 Message-ID: <87pmctkkzz.fsf@ledu-giraud.fr> References: <87o7shhjwt.fsf@ledu-giraud.fr> <837cz593az.fsf@gnu.org> <877cz5hh42.fsf@ledu-giraud.fr> <835yep8wzm.fsf@gnu.org> <875yeoj046.fsf@ledu-giraud.fr> <83pmcw7m58.fsf@gnu.org> <87mt805wnu.fsf@ledu-giraud.fr> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="19633"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: 59838@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri Dec 09 10:03:36 2022 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1p3ZI7-0004ud-QT for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 09 Dec 2022 10:03:35 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1p3ZI0-0004wm-Ks; Fri, 09 Dec 2022 04:03:28 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1p3ZHa-0004s2-F1 for bug-gnu-emacs@gnu.org; Fri, 09 Dec 2022 04:03:02 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1p3ZHZ-0001K0-QW for bug-gnu-emacs@gnu.org; Fri, 09 Dec 2022 04:03:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1p3ZHZ-0004vy-Lk for bug-gnu-emacs@gnu.org; Fri, 09 Dec 2022 04:03:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Manuel Giraud Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 09 Dec 2022 09:03:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 59838 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 59838-submit@debbugs.gnu.org id=B59838.167057656818955 (code B ref 59838); Fri, 09 Dec 2022 09:03:01 +0000 Original-Received: (at 59838) by debbugs.gnu.org; 9 Dec 2022 09:02:48 +0000 Original-Received: from localhost ([127.0.0.1]:34709 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p3ZHL-0004vf-Hu for submit@debbugs.gnu.org; Fri, 09 Dec 2022 04:02:47 -0500 Original-Received: from ledu-giraud.fr ([51.159.28.247]:22829) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p3ZHJ-0004vX-Iq for 59838@debbugs.gnu.org; Fri, 09 Dec 2022 04:02:46 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; s=rsa; bh=hraeZ8xajYKT7oO0 UAzkBT7UqYESUe6vXWNU3ZhddqI=; h=date:references:in-reply-to:subject: cc:to:from; d=ledu-giraud.fr; b=ZS69xd8cYeNvZnLfmdjIb5hmMafIsksui61ZCC wOPuYQ6myfYDarQYTVCJCZUdRyLtqmlRqNPFQKxCJxBWGI9jcYb2FdaNgtDGNuZhYL0Laq xqYhwiODoSvNgZjxm5RYb+0LBe8JSB1VPSRkS1uSAZJaI5diQ159pGpAs0IGPBH00F4ilo X2eycIUYCyKKcIyQQ5zGnplZg+N27XT043CuajSoyhq8svHWl66dcEzSMmvsPM/M68pE7K FkRK5KJSuUgDOtVuzwvbpns6gDrnqm7m/cjYeawkYM763WqHrS9ivkGAs6rkN8aZtWHSEu YUq0Uj8T1Wiy0UebsLVhYq/g== Original-Received: from computer ( [10.1.1.1]) by ledu-giraud.fr (OpenSMTPD) with ESMTPSA id 3a571365 (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO); Fri, 9 Dec 2022 10:02:43 +0100 (CET) In-Reply-To: <87mt805wnu.fsf@ledu-giraud.fr> (Manuel Giraud's message of "Tue, 06 Dec 2022 17:23:01 +0100") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:250367 Archived-At: --=-=-= Content-Type: text/plain Hi, I think I have found the right place. I've tested it with "M-x gdb" doing an explicit "quit" or using `C-d'. I've also tested with "M-x gud-gdb". Now I think we'll need a patch to gitignore the .gbd_history files into the emacs directory. --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=0001-Fix-GDB-save-history-bug-59838.patch >From 38d29bb31a821e0b03444e4008b80b39834ef842 Mon Sep 17 00:00:00 2001 From: Manuel Giraud Date: Mon, 5 Dec 2022 17:48:15 +0100 Subject: [PATCH] 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. --- lisp/progmodes/gdb-mi.el | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/lisp/progmodes/gdb-mi.el b/lisp/progmodes/gdb-mi.el index e8d8f9104e..a7839c34af 100644 --- a/lisp/progmodes/gdb-mi.el +++ b/lisp/progmodes/gdb-mi.el @@ -1113,13 +1113,13 @@ gdb-delchar-or-quit (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.") @@ -5124,6 +5124,8 @@ gdb-restore-windows (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"))) -- 2.38.1 --=-=-= Content-Type: text/plain -- Manuel Giraud --=-=-=--