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: Thu, 08 Dec 2022 11:28:43 +0100 Message-ID: <87359qmbok.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="20908"; 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 Thu Dec 08 11:29:20 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 1p3E9X-0005EJ-Gs for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 08 Dec 2022 11:29:19 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1p3E9H-0003LD-JC; Thu, 08 Dec 2022 05:29:03 -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 1p3E9G-0003L5-Pm for bug-gnu-emacs@gnu.org; Thu, 08 Dec 2022 05:29: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 1p3E9G-0004Ef-HS for bug-gnu-emacs@gnu.org; Thu, 08 Dec 2022 05:29:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1p3E9G-0008PX-Cp for bug-gnu-emacs@gnu.org; Thu, 08 Dec 2022 05:29:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Manuel Giraud Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 08 Dec 2022 10:29:02 +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.167049533032321 (code B ref 59838); Thu, 08 Dec 2022 10:29:02 +0000 Original-Received: (at 59838) by debbugs.gnu.org; 8 Dec 2022 10:28:50 +0000 Original-Received: from localhost ([127.0.0.1]:55897 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p3E93-0008PF-Mz for submit@debbugs.gnu.org; Thu, 08 Dec 2022 05:28:50 -0500 Original-Received: from ledu-giraud.fr ([51.159.28.247]:32834) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p3E90-0008P9-5P for 59838@debbugs.gnu.org; Thu, 08 Dec 2022 05:28:48 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; s=rsa; bh=pAkAV+/Jr17jrEXE MA1n5v0cxt1C+9ANZFgfFKwCpwg=; h=date:references:in-reply-to:subject: cc:to:from; d=ledu-giraud.fr; b=z6yvNsmsfw4TvlIdeuznChH8ASvWtU9LNsTbRt B5S+4mCa4zCTSD4jMd7qvVv7mtici2V5QZpwvWPGpT9O2kUVCy8xo8G+Kdo9jeMUNV0+ez ycAFVPTYH7+bPhApuRT4hKlugE68IOU1CQ1v/q0aR95rCWFtCGi7U2hIF8t685QwoeQuKY CxZUt3VSqbEqcj3wQNE+W2/8JN9Oqyc822KrkqrsXwJ996uk2MEp6SE+G9Nz5e/r9fGufK oZCsFKl8p7KLzs15GAIWZnsLCTlEvefdrXkI2RtW2YP14NrGD8/yYZY1ksvocRymf9YEf0 GehlD4yLumoUDksXoyYd373g== Original-Received: from computer ( [10.1.1.1]) by ledu-giraud.fr (OpenSMTPD) with ESMTPSA id 9511c620 (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO); Thu, 8 Dec 2022 11:28:44 +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:250264 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 --=-=-=--