From unknown Sat Jun 21 12:11:32 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#59838 <59838@debbugs.gnu.org> To: bug#59838 <59838@debbugs.gnu.org> Subject: Status: 30.0.50; [PATCH] Save history in GDB session Reply-To: bug#59838 <59838@debbugs.gnu.org> Date: Sat, 21 Jun 2025 19:11:32 +0000 retitle 59838 30.0.50; [PATCH] Save history in GDB session reassign 59838 emacs submitter 59838 Manuel Giraud severity 59838 normal tag 59838 patch thanks From debbugs-submit-bounces@debbugs.gnu.org Mon Dec 05 11:53:18 2022 Received: (at submit) by debbugs.gnu.org; 5 Dec 2022 16:53:18 +0000 Received: from localhost ([127.0.0.1]:37171 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p2EiT-0007bo-Lq for submit@debbugs.gnu.org; Mon, 05 Dec 2022 11:53:18 -0500 Received: from lists.gnu.org ([209.51.188.17]:50930) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p2EiR-0007bi-DB for submit@debbugs.gnu.org; Mon, 05 Dec 2022 11:53:16 -0500 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 1p2EiQ-00026Q-Dc for bug-gnu-emacs@gnu.org; Mon, 05 Dec 2022 11:53:14 -0500 Received: from ledu-giraud.fr ([51.159.28.247]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1p2EiN-0000iR-GY for bug-gnu-emacs@gnu.org; Mon, 05 Dec 2022 11:53:14 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; s=rsa; bh=ih+VAbTTwsf+M/pC KKoZxJ1jsNDSzDKPf+iEKqKswPE=; h=date:subject:to:from; d=ledu-giraud.fr; b=Gag7Dxz0MTqZ2sfuLwQd4NthrEFurAz/qW1Su0RtCDAPsx4AAi E4jjOyrB8Q7HbvvOs4ptvgDuqEG9gUlHDWTTZk32pNZ2yyUwphItGG9eV0HE/+itwgwcHY zZheFksx4/JZc2J7BsvGHfOp3MxG2hTS118Zn7OPo4KEhZrxlF1tNZQJliHdja6G/CiEys NjBrPhbshpvItX2h5m/CXxp+tZ38Ow7dp8dV6cbkWHL3R/9HG6xMWXbdr/8NsAFnrRH4IH cgGYsg0RP3zBlO1ajPKNAWSLd83mtoQ/AUZwk/13oVL86Wcc7uLdI+NN1G6dhpE50NJhRv AqEixwat5uQA== Received: from computer ( [10.1.1.1]) by ledu-giraud.fr (OpenSMTPD) with ESMTPSA id 3ccf7e96 (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO); Mon, 5 Dec 2022 17:53:07 +0100 (CET) From: Manuel Giraud To: bug-gnu-emacs@gnu.org Subject: 30.0.50; [PATCH] Save history in GDB session Date: Mon, 05 Dec 2022 17:53:06 +0100 Message-ID: <87o7shhjwt.fsf@ledu-giraud.fr> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Received-SPF: pass client-ip=51.159.28.247; envelope-from=manuel@ledu-giraud.fr; helo=ledu-giraud.fr X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: -1.4 (-) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.4 (--) --=-=-= Content-Type: text/plain Hi, I'm not really an expert in gdb (and comint-mode) but it seems that 'M-x gdb' does not save its history. Here is a patch that fix this. --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=0001-lisp-progmodes-gdb-mi.el-gdb-send-Write-history.patch >From 07b0df98158999901c639f99ca27ffefebeec5d1 Mon Sep 17 00:00:00 2001 From: Manuel Giraud Date: Mon, 5 Dec 2022 17:48:15 +0100 Subject: [PATCH] * lisp/progmodes/gdb-mi.el (gdb-send): Write history. --- lisp/progmodes/gdb-mi.el | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lisp/progmodes/gdb-mi.el b/lisp/progmodes/gdb-mi.el index e8d8f9104e..ebedfa5cde 100644 --- a/lisp/progmodes/gdb-mi.el +++ b/lisp/progmodes/gdb-mi.el @@ -1966,7 +1966,9 @@ gdb-send (or (not python-or-guile-p) (null command-arg) (zerop (length command-arg)))) - (setq gdb-control-level (1+ gdb-control-level))))) + (setq gdb-control-level (1+ gdb-control-level)))) + ;; Write history upon each command + (comint-write-input-ring)) (defun gdb-mi-quote (string) "Return STRING quoted properly as an MI argument. -- 2.38.1 --=-=-= Content-Type: text/plain In GNU Emacs 30.0.50 (build 1, x86_64-unknown-openbsd7.2, cairo version 1.17.6) of 2022-12-05 built on computer Repository revision: 4fa37dc426184811e39ce113f6af7f5b308f116b Repository branch: mgi/svg-trouble Windowing system distributor 'The X.Org Foundation', version 11.0.12101004 System Description: OpenBSD computer 7.2 GENERIC.MP#859 amd64 Configured using: 'configure --prefix=/home/manuel/emacs --bindir=/home/manuel/bin --with-x-toolkit=no --without-sound --without-compress-install CPPFLAGS=-I/usr/local/include LDFLAGS=-L/usr/local/lib' Configured features: CAIRO DBUS FREETYPE GIF GLIB GMP GNUTLS GSETTINGS HARFBUZZ JPEG JSON LCMS2 LIBOTF LIBXML2 MODULES NOTIFY KQUEUE OLDXMENU PDUMPER PNG RSVG SQLITE3 THREADS TIFF TREE_SITTER WEBP X11 XDBE XIM XINPUT2 XPM ZLIB Important settings: value of $LC_ALL: en_US.UTF-8 locale-coding-system: utf-8-unix Major mode: Change Log Minor modes in effect: gdb-many-windows: t global-git-commit-mode: t magit-auto-revert-mode: t display-time-mode: t display-battery-mode: t server-mode: t shell-dirtrack-mode: t global-so-long-mode: t repeat-mode: t global-eldoc-mode: t show-paren-mode: t electric-indent-mode: t mouse-wheel-mode: t menu-bar-mode: t file-name-shadow-mode: t global-font-lock-mode: t font-lock-mode: t blink-cursor-mode: t line-number-mode: t auto-fill-function: do-auto-fill indent-tabs-mode: t transient-mark-mode: t auto-composition-mode: t auto-encryption-mode: t auto-compression-mode: t Load-path shadows: /home/manuel/.emacs.d/elpa/ef-themes-0.10.0/theme-loaddefs hides /home/manuel/emacs/share/emacs/30.0.50/lisp/theme-loaddefs /home/manuel/.emacs.d/elpa/transient-0.3.7/transient hides /home/manuel/emacs/share/emacs/30.0.50/lisp/transient Features: (shadow whitespace magit-patch ob-ditaa ob-plantuml ol-bibtex bibtex org-clock org-colview org-crypt org-ctags org-habit org-mouse org-plot org-protocol ox-odt rng-loc rng-uri rng-parse rng-match rng-dt rng-util rng-pttrn nxml-parse nxml-ns nxml-enc xmltok nxml-util ox-latex ox-icalendar org-agenda ox-html table ox-ascii ox-publish ox hsys-org org-element org-persist xdg org-id org-refile avl-tree hsettings hui-em-but hbut view hbdata hgnus hvar hsmail hypb locate hact set hhist hmail htz cal-julian hbmap hmoccur hversion hload-path ob-C ob-R ob-awk ob-calc calc-store calc-trail ob-clojure ob-css ob-dot ob-eshell eshell esh-cmd esh-ext esh-opt esh-proc esh-io esh-arg esh-module esh-groups esh-util ob-forth ob-fortran ob-gnuplot ob-groovy ob-haskell ob-java ob-js ob-julia ob-latex ob-lilypond ob-lisp ob-lua ob-makefile ob-maxima ob-ocaml ob-octave ob-org ob-perl ob-processing ob-python python ob-ruby ob-sass ob-scheme ob-screen ob-sed ob-shell ob-sqlite ob-sql vc-annotate vc ibuf-ext ibuffer ibuffer-loaddefs dabbrev shortdoc cl-print help-fns radix-tree proced tabify man gdb-mi bindat gud bug-reference magit-extras face-remap magit-bookmark magit-submodule magit-obsolete magit-blame magit-stash magit-reflog magit-bisect magit-push magit-pull magit-fetch magit-clone magit-remote magit-commit magit-sequence magit-notes magit-worktree magit-tag magit-merge magit-branch magit-reset magit-files magit-refs magit-status magit magit-repos magit-apply magit-wip magit-log which-func imenu magit-diff smerge-mode diff git-commit log-edit pcvs-util add-log magit-core magit-autorevert autorevert magit-margin magit-transient magit-process with-editor magit-mode transient magit-git magit-section magit-utils dash misearch multi-isearch vc-svn sort gnus-cite mail-extr textsec uni-scripts idna-mapping ucs-normalize uni-confusable textsec-check gnus-async gnus-bcklg gnus-ml gnus-topic mm-archive url-http url-gw url-cache url-auth qp utf-7 imap nndoc nndraft nnmh nnfolder nnml gnus-agent gnus-srvr gnus-score score-mode nnvirtual nntp gnus-cache nnrss mm-url w3m doc-view filenotify jka-compr image-mode exif w3m-hist w3m-fb bookmark-w3m w3m-ems w3m-favicon w3m-image tab-line w3m-proc w3m-util pcmpl-linux vc-hg vc-git diff-mode vc-bzr vc-dispatcher rfc2104 tramp-cache time-stamp tramp-sh network-stream nsm emacsbug pulse gnus-dired sh-script smie treesit executable cus-start paredit edmacro time battery exwm-randr xcb-randr exwm-config exwm exwm-input xcb-keysyms xcb-xkb exwm-manage exwm-floating xcb-cursor xcb-render exwm-layout exwm-workspace exwm-core xcb-ewmh xcb-icccm xcb xcb-xproto xcb-types xcb-debug kmacro server stimmung-themes modus-operandi-theme modus-themes ytdious osm mingus libmpdee reporter edebug debug backtrace transmission diary-lib diary-loaddefs color calc-bin calc-ext calc calc-loaddefs rect calc-macs w3m-load mu4e mu4e-org mu4e-main mu4e-view mu4e-headers mu4e-compose mu4e-draft mu4e-actions smtpmail mu4e-search mu4e-lists mu4e-bookmarks mu4e-mark mu4e-message flow-fill mule-util hl-line mu4e-contacts mu4e-update mu4e-folders mu4e-server mu4e-context mu4e-vars mu4e-helpers mu4e-config bookmark ido supercite regi ebdb-message ebdb-gnus gnus-msg gnus-art mm-uu mml2015 mm-view mml-smime smime gnutls dig gnus-sum shr pixel-fill kinsoku url-file svg dom gnus-group gnus-undo gnus-start gnus-dbus gnus-cloud nnimap nnmail mail-source utf7 nnoo gnus-spec gnus-int gnus-range message sendmail yank-media puny rfc822 mml mml-sec epa epg rfc6068 epg-config mm-decode mm-bodies mm-encode mail-parse rfc2231 rfc2047 rfc2045 ietf-drums gmm-utils mailheader gnus-win gnus nnheader gnus-util mail-utils range mm-util mail-prsvr ebdb-mua ebdb-com crm ebdb-format ebdb mailabbrev eieio-opt cl-extra help-mode speedbar ezimage dframe eieio-base pcase timezone org ob ob-tangle ob-ref ob-lob ob-table ob-exp org-macro org-src ob-comint org-pcomplete org-list org-footnote org-faces org-entities ob-emacs-lisp ob-core ob-eval org-cycle org-table ol org-fold org-fold-core org-keys oc org-loaddefs find-func cal-menu calendar cal-loaddefs org-version org-compat org-macs visual-basic-mode cl web-mode derived disp-table erlang-start smart-tabs-mode skeleton cc-mode cc-fonts cc-guess cc-menus cc-cmds cc-styles cc-align cc-engine cc-vars cc-defs slime-asdf grep slime-tramp tramp tramp-loaddefs trampver tramp-integration cus-edit cus-load wid-edit files-x tramp-compat rx shell pcomplete parse-time iso8601 time-date ls-lisp format-spec slime-fancy slime-indentation slime-cl-indent cl-indent slime-trace-dialog slime-fontifying-fu slime-package-fu slime-references slime-compiler-notes-tree advice slime-scratch slime-presentations bridge slime-macrostep macrostep slime-mdot-fu slime-enclosing-context slime-fuzzy slime-fancy-trace slime-fancy-inspector slime-c-p-c slime-editing-commands slime-autodoc slime-repl slime-parse slime compile text-property-search etags fileloop generator xref project arc-mode archive-mode noutline outline icons pp comint ansi-osc ansi-color ring hyperspec thingatpt slime-autoloads dired-aux dired-x dired dired-loaddefs so-long notifications dbus xml repeat easy-mmode rust-mode-autoloads stimmung-themes-autoloads ebdb-autoloads magit-autoloads debbugs-autoloads git-commit-autoloads magit-section-autoloads ef-themes-autoloads with-editor-autoloads paredit-autoloads dash-autoloads ytdious-autoloads transmission-autoloads transient-autoloads exwm-autoloads hyperbole-autoloads detached-autoloads info package browse-url url url-proxy url-privacy url-expand url-methods url-history url-cookie generate-lisp-file url-domsuf url-util mailcap url-handlers url-parse auth-source cl-seq eieio eieio-core cl-macs password-cache json subr-x map byte-opt gv bytecomp byte-compile url-vars cl-loaddefs cl-lib rmc iso-transl tooltip cconv eldoc paren electric uniquify ediff-hook vc-hooks lisp-float-type elisp-mode mwheel term/x-win x-win term/common-win x-dnd tool-bar dnd fontset image regexp-opt fringe tabulated-list replace newcomment text-mode lisp-mode prog-mode register page tab-bar menu-bar rfn-eshadow isearch easymenu timer select scroll-bar mouse jit-lock font-lock syntax font-core term/tty-colors frame minibuffer nadvice seq simple cl-generic indonesian philippine cham georgian utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao korean japanese eucjp-ms cp51932 hebrew greek romanian slovak czech european ethiopic indian cyrillic chinese composite emoji-zwj charscript charprop case-table epa-hook jka-cmpr-hook help abbrev obarray oclosure cl-preloaded button loaddefs theme-loaddefs faces cus-face macroexp files window text-properties overlay sha1 md5 base64 format env code-pages mule custom widget keymap hashtable-print-readable backquote threads dbusbind kqueue lcms2 dynamic-setting system-font-setting font-render-setting cairo xinput2 x multi-tty make-network-process emacs) Memory information: ((conses 16 1325793 307023) (symbols 48 70022 13) (strings 32 342856 14419) (string-bytes 1 10944812) (vectors 16 219440) (vector-slots 8 3492670 116033) (floats 8 859 791) (intervals 56 37544 5279) (buffers 992 62)) -- Manuel Giraud --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Mon Dec 05 12:19:31 2022 Received: (at 59838) by debbugs.gnu.org; 5 Dec 2022 17:19:31 +0000 Received: from localhost ([127.0.0.1]:37311 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p2F7r-0007qs-8k for submit@debbugs.gnu.org; Mon, 05 Dec 2022 12:19:31 -0500 Received: from eggs.gnu.org ([209.51.188.92]:55376) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p2F7p-0007qm-43 for 59838@debbugs.gnu.org; Mon, 05 Dec 2022 12:19:29 -0500 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1p2F7j-00059Z-GY; Mon, 05 Dec 2022 12:19:23 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=08Hr7S0nVhYBlU+tNLQhQsNYSfSoTYGN0USMYuw0VrM=; b=fe0jhxwSOZdd VyE39pzzAtq1bNkGobF5S1FI04IHi30V0xlutEnO5eHSPZwAS+RpBDtu3Nnj5tEteFs8qAw2Qg/qH jyvWwdyWvsM/27jkXV9i1RU1898EtAPvTe7Evc2MaH2dJBc6tTtPECjBIijLdsG/LyiULjINKE9VX iBE47WMeNh0RBM5eD9RWJD5sXANj82S14lHlZgUjFwL8dizCHw9Xnle2L/1eZ7BY1Y+CZ4Ju/1HZv Fjtraqz63oR6q1lbLo8tWYncB5uOXJype2lcPx1tnmHGrDw3fzm2Ma1JDCvT4K2aNcdb30A+sYKXS HZ+jD/4vWjSd/uPv8t+5Mg==; Received: from [87.69.77.57] (helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1p2F7c-0000ao-Qs; Mon, 05 Dec 2022 12:19:23 -0500 Date: Mon, 05 Dec 2022 19:19:00 +0200 Message-Id: <837cz593az.fsf@gnu.org> From: Eli Zaretskii To: Manuel Giraud In-Reply-To: <87o7shhjwt.fsf@ledu-giraud.fr> (message from Manuel Giraud on Mon, 05 Dec 2022 17:53:06 +0100) Subject: Re: bug#59838: 30.0.50; [PATCH] Save history in GDB session References: <87o7shhjwt.fsf@ledu-giraud.fr> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 59838 Cc: 59838@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > From: Manuel Giraud > Date: Mon, 05 Dec 2022 17:53:06 +0100 > > I'm not really an expert in gdb (and comint-mode) but it seems that 'M-x > gdb' does not save its history. Here is a patch that fix this. GDB has its own history feature, activated by the GDB command "set history save on". If the GDB history file is detected when "M-x gdb" starts, it will read the history and fill comint-input-ring with what it finds there. See the function 'gdb' in gdb-mi.el. So I think this is already covered, or what did I miss? Thanks. From debbugs-submit-bounces@debbugs.gnu.org Mon Dec 05 12:53:37 2022 Received: (at 59838) by debbugs.gnu.org; 5 Dec 2022 17:53:37 +0000 Received: from localhost ([127.0.0.1]:37471 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p2Fer-0008AA-0N for submit@debbugs.gnu.org; Mon, 05 Dec 2022 12:53:37 -0500 Received: from ledu-giraud.fr ([51.159.28.247]:26348) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p2Fep-0008A4-CO for 59838@debbugs.gnu.org; Mon, 05 Dec 2022 12:53:36 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; s=rsa; bh=0edyh9A0p0x1KJsT 8iQe58gL2atye0dY2GjpRkv9Bwc=; h=date:references:in-reply-to:subject: cc:to:from; d=ledu-giraud.fr; b=HBO72CXbKFJ6JDdmb5E/iv7nlZ/k5K3lQGMLiI HsRivqYeeZf92/3iTWmRqCCpsKY6dpsFe/9jt2WY2FXfEs2G/NTxX8ifa1JKVAPXS4nEXN EIHwpKD8G54zr4tYIMnwth/BsOj8RfGK8jexpwM0AcyXcE9FgmGd2yxuPNuaFw5gxg5Dv0 rQ6vJ10OWbbDRiN9FUaUL8IqYkImcFF8ucnJqyq3s2OhEWK5DeoMJbUKzg716wUAIUxlpz YGXvQSPWj9RZ5Co4XG6QEjWvcDfAmLsOjDEt+l8rUnZxy2/Bad+pD6Embo+XK/gDsrI2Zw SH6B3DOAqQZXn2EqkUw+IjTw== Received: from computer ( [10.1.1.1]) by ledu-giraud.fr (OpenSMTPD) with ESMTPSA id 62f2797f (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO); Mon, 5 Dec 2022 18:53:34 +0100 (CET) From: Manuel Giraud To: Eli Zaretskii Subject: Re: bug#59838: 30.0.50; [PATCH] Save history in GDB session In-Reply-To: <837cz593az.fsf@gnu.org> (Eli Zaretskii's message of "Mon, 05 Dec 2022 19:19:00 +0200") References: <87o7shhjwt.fsf@ledu-giraud.fr> <837cz593az.fsf@gnu.org> Date: Mon, 05 Dec 2022 18:53:33 +0100 Message-ID: <877cz5hh42.fsf@ledu-giraud.fr> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 59838 Cc: 59838@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Eli Zaretskii writes: >> From: Manuel Giraud >> Date: Mon, 05 Dec 2022 17:53:06 +0100 >> >> I'm not really an expert in gdb (and comint-mode) but it seems that 'M-x >> gdb' does not save its history. Here is a patch that fix this. > > GDB has its own history feature, activated by the GDB command "set history > save on". If the GDB history file is detected when "M-x gdb" starts, it > will read the history and fill comint-input-ring with what it finds there. > See the function 'gdb' in gdb-mi.el. > > So I think this is already covered, or what did I miss? I already have this in my ~/.gdbinit: --8<---------------cut here---------------start------------->8--- set history save on set history size 1024 add-auto-load-safe-path /home/manuel/emacs-repo/src/.gdbinit --8<---------------cut here---------------end--------------->8--- When debugging emacs from 'M-x gdb', gdb does create a file "/home/manuel/emacs-repo/src/.gdb_history" but it always stays empty even when I "quit" from the *gud-emacs* buffer. -- Manuel Giraud From debbugs-submit-bounces@debbugs.gnu.org Mon Dec 05 14:36:05 2022 Received: (at 59838) by debbugs.gnu.org; 5 Dec 2022 19:36:05 +0000 Received: from localhost ([127.0.0.1]:37921 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p2HG0-0000ff-Uw for submit@debbugs.gnu.org; Mon, 05 Dec 2022 14:36:05 -0500 Received: from eggs.gnu.org ([209.51.188.92]:33254) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p2HFy-0000fI-VM for 59838@debbugs.gnu.org; Mon, 05 Dec 2022 14:36:03 -0500 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1p2HFn-0001dq-4w; Mon, 05 Dec 2022 14:35:57 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=7ljjLADAPUFe74upYUbJQID3+9m7bITv87vGJNK8PC0=; b=aRg8gnkihP4E +VH5DqkQ19oP73wIdMuanCOUbOYRh3YaffkZOgj+b+paeORpBL/AWnQLXOS/DKDoiyyccEUHO+mZb amJa70+MLgAJGcnZ4MdSeDgkwLZe7m8PVne8JpxiA+RpSX0gwhnYEDVE3oPBTLvqbf4lYkwDeGJvc hbXTArfl7sNhSI5/2SVosXVRcxl/3cAeDItf3c5LnEsUUQyJnfgRxcRRiTdlBNkskGVNerMdekybC X7PnCN5PPvfn/V9cJSFIr7VJfadafASwk7PRTO92gwi8skh6EkoxHRZNEtX5lcqBvIP0iVGBAhRQH SuaHrxJgl2evLuf+cDRZ7A==; Received: from [87.69.77.57] (helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1p2HFd-0005aj-MG; Mon, 05 Dec 2022 14:35:49 -0500 Date: Mon, 05 Dec 2022 21:35:25 +0200 Message-Id: <835yep8wzm.fsf@gnu.org> From: Eli Zaretskii To: Manuel Giraud In-Reply-To: <877cz5hh42.fsf@ledu-giraud.fr> (message from Manuel Giraud on Mon, 05 Dec 2022 18:53:33 +0100) Subject: Re: bug#59838: 30.0.50; [PATCH] Save history in GDB session References: <87o7shhjwt.fsf@ledu-giraud.fr> <837cz593az.fsf@gnu.org> <877cz5hh42.fsf@ledu-giraud.fr> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 59838 Cc: 59838@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > From: Manuel Giraud > Cc: 59838@debbugs.gnu.org > Date: Mon, 05 Dec 2022 18:53:33 +0100 > > Eli Zaretskii writes: > > >> From: Manuel Giraud > >> Date: Mon, 05 Dec 2022 17:53:06 +0100 > >> > >> I'm not really an expert in gdb (and comint-mode) but it seems that 'M-x > >> gdb' does not save its history. Here is a patch that fix this. > > > > GDB has its own history feature, activated by the GDB command "set history > > save on". If the GDB history file is detected when "M-x gdb" starts, it > > will read the history and fill comint-input-ring with what it finds there. > > See the function 'gdb' in gdb-mi.el. > > > > So I think this is already covered, or what did I miss? > > I already have this in my ~/.gdbinit: > --8<---------------cut here---------------start------------->8--- > set history save on > set history size 1024 > add-auto-load-safe-path /home/manuel/emacs-repo/src/.gdbinit > --8<---------------cut here---------------end--------------->8--- > > When debugging emacs from 'M-x gdb', gdb does create a file > "/home/manuel/emacs-repo/src/.gdb_history" but it always stays empty > even when I "quit" from the *gud-emacs* buffer. I guess this is because GDB's history works via Readline, and Readline is not used when Emacs is the front end. Then I think your patch is correct, thanks. From debbugs-submit-bounces@debbugs.gnu.org Tue Dec 06 05:30:06 2022 Received: (at 59838) by debbugs.gnu.org; 6 Dec 2022 10:30:06 +0000 Received: from localhost ([127.0.0.1]:42040 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p2VDC-0005di-Ar for submit@debbugs.gnu.org; Tue, 06 Dec 2022 05:30:06 -0500 Received: from ledu-giraud.fr ([51.159.28.247]:19054) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p2VDA-0005dc-7k for 59838@debbugs.gnu.org; Tue, 06 Dec 2022 05:30:04 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; s=rsa; bh=dSl8oSpERv3zXAZl qDapMExiXYogZADkL39R6f3Uo6c=; h=date:references:in-reply-to:subject: cc:to:from; d=ledu-giraud.fr; b=bv/xHhGJM5FnJelEbB1VX8WSfkR+/uGuo+yq9P db7bgBQ2ExNFA2jH8yrpbMmPc0c8L1QqmbMydxmlu7IN+ij7qEwA9cm4udPZk65vUpPP6B d+2+LjP2MiLMubvh05GvDAtZa7YUMYLPs22+oZSbssnBts+PKAA387dSVfkwtYbvLEqhHp 7aMf4CNL4daYMu+in6e7lQO09DGZ420FWes53yFQfz1JDr6jtSWTxEDVXvUQLwEN4k4B1u geSUZtnUziMKv+0pTQlU9csGilOU8xv0S4GRrpqEQRDFMAWBQo4LTnSUvq8Nkr2BauBc0e Zspb04lbulu/sxKW6k/HGzfw== Received: from computer ( [10.1.1.1]) by ledu-giraud.fr (OpenSMTPD) with ESMTPSA id a5308afc (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO); Tue, 6 Dec 2022 11:30:02 +0100 (CET) From: Manuel Giraud To: Eli Zaretskii Subject: Re: bug#59838: 30.0.50; [PATCH] Save history in GDB session In-Reply-To: <835yep8wzm.fsf@gnu.org> (Eli Zaretskii's message of "Mon, 05 Dec 2022 21:35:25 +0200") References: <87o7shhjwt.fsf@ledu-giraud.fr> <837cz593az.fsf@gnu.org> <877cz5hh42.fsf@ledu-giraud.fr> <835yep8wzm.fsf@gnu.org> Date: Tue, 06 Dec 2022 11:30:01 +0100 Message-ID: <875yeoj046.fsf@ledu-giraud.fr> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 59838 Cc: 59838@debbugs.gnu.org, Manuel Giraud X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Eli Zaretskii writes: [...] > I guess this is because GDB's history works via Readline, and Readline is > not used when Emacs is the front end. Ok. > Then I think your patch is correct, thanks. But as I said, I'm not an expert with comint-mode stuff. I put '(comint-write-input-ring)' at the end of gdb-send because it seems to make sense but I don't know for sure. -- Manuel Giraud From debbugs-submit-bounces@debbugs.gnu.org Tue Dec 06 07:27:42 2022 Received: (at 59838) by debbugs.gnu.org; 6 Dec 2022 12:27:42 +0000 Received: from localhost ([127.0.0.1]:42705 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p2X2y-00073E-RS for submit@debbugs.gnu.org; Tue, 06 Dec 2022 07:27:42 -0500 Received: from eggs.gnu.org ([209.51.188.92]:49904) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p2X2u-000738-BA for 59838@debbugs.gnu.org; Tue, 06 Dec 2022 07:27:39 -0500 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1p2X2o-0001CJ-9s; Tue, 06 Dec 2022 07:27:31 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=C8/d7nqQeCUB94Xhf0+PgTT4yqnR5+o4X627Kohl9VA=; b=BOdPPJDS5WBU 9yfG7hibXHYTKRsqyaqZUU+tubaWcfwTt2U4D8c8YOPNbh5B/wE/XzkPJIsDdwxp9k2leuXREkdal BIjkJPm/bMhIfOp05L8ceCpOe7Cju0/xIDu0kej+Zpxl1g1P4MD0a2GkVRUM8mS8CrseGVcFhPz1D TSPp15xZGn+dfyGr/kAk3czCu41lXVcd6fFlUWBfOGKIyPma4i3GbiraN661O3SDDt2+sVp7AA8sJ NjO7ZznNlkl+7bvb0/vWqQQYfZ5oVtyAVr2TmDolPcjPvaVgUC3R5UnHlYfPJIP6Cd69hyzkwWDOo Rov9tOjybLvR+xjM/R3qfw==; Received: from [87.69.77.57] (helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1p2X2n-00042z-15; Tue, 06 Dec 2022 07:27:30 -0500 Date: Tue, 06 Dec 2022 14:27:15 +0200 Message-Id: <83pmcw7m58.fsf@gnu.org> From: Eli Zaretskii To: Manuel Giraud In-Reply-To: <875yeoj046.fsf@ledu-giraud.fr> (message from Manuel Giraud on Tue, 06 Dec 2022 11:30:01 +0100) Subject: Re: bug#59838: 30.0.50; [PATCH] Save history in GDB session References: <87o7shhjwt.fsf@ledu-giraud.fr> <837cz593az.fsf@gnu.org> <877cz5hh42.fsf@ledu-giraud.fr> <835yep8wzm.fsf@gnu.org> <875yeoj046.fsf@ledu-giraud.fr> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 59838 Cc: 59838@debbugs.gnu.org, manuel@ledu-giraud.fr X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > From: Manuel Giraud > Cc: Manuel Giraud , 59838@debbugs.gnu.org > Date: Tue, 06 Dec 2022 11:30:01 +0100 > > > Then I think your patch is correct, thanks. > > But as I said, I'm not an expert with comint-mode stuff. I put > '(comint-write-input-ring)' at the end of gdb-send because it seems to > make sense but I don't know for sure. I think the call should be where the gud buffer is killed or we exit the debugger, not after each string we send to the debugger. From debbugs-submit-bounces@debbugs.gnu.org Tue Dec 06 11:23:09 2022 Received: (at 59838) by debbugs.gnu.org; 6 Dec 2022 16:23:09 +0000 Received: from localhost ([127.0.0.1]:43811 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p2air-0005Sk-6g for submit@debbugs.gnu.org; Tue, 06 Dec 2022 11:23:09 -0500 Received: from ledu-giraud.fr ([51.159.28.247]:29573) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p2aim-0005Se-5k for 59838@debbugs.gnu.org; Tue, 06 Dec 2022 11:23:07 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; s=rsa; bh=EcPY37vUII7NaLuY TCbZNNmVD8AZZTuK3mIjGOnzti0=; h=date:references:in-reply-to:subject: cc:to:from; d=ledu-giraud.fr; b=ZSuinoW2+81NFpPXjfKcEPALDucmaZQQqE+CeX XNM1L90Defq07QFAQzVZx6/ll15J0lmt0QoH4OOlX1p3aY4v958jvYRpuJv5AC9y31bXwv z81xF+LvMIfRggrLyNW6cg01VoSbKEIX9VQp9rk5WJry4ncAYqeJJaRMVwgod+oOdK4ZCE TYEykKlhEVLeSWRNqh5BeyRftVwgxhThAJuRbGBA55InCYF1iFmjym7Cj+GDz9vbGJN60D 5vJTmeXBCusGpcFcUBith1sHXxI70GVtWbN7GVjoKaRHLuwu0uuxZ7r4NkDT5XyOGHMeJw 4binekHcjrOUMFb9Rk/DkWkQ== Received: from computer ( [10.1.1.1]) by ledu-giraud.fr (OpenSMTPD) with ESMTPSA id f620f49c (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO); Tue, 6 Dec 2022 17:23:02 +0100 (CET) From: Manuel Giraud To: Eli Zaretskii Subject: Re: bug#59838: 30.0.50; [PATCH] Save history in GDB session In-Reply-To: <83pmcw7m58.fsf@gnu.org> (Eli Zaretskii's message of "Tue, 06 Dec 2022 14:27:15 +0200") 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> Date: Tue, 06 Dec 2022 17:23:01 +0100 Message-ID: <87mt805wnu.fsf@ledu-giraud.fr> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 59838 Cc: 59838@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) Eli Zaretskii writes: [...] >> But as I said, I'm not an expert with comint-mode stuff. I put >> '(comint-write-input-ring)' at the end of gdb-send because it seems to >> make sense but I don't know for sure. > > I think the call should be where the gud buffer is killed or we exit the > debugger, not after each string we send to the debugger. Alright, I'll try to find this place ;-) -- Manuel Giraud From debbugs-submit-bounces@debbugs.gnu.org Thu Dec 08 05:28:50 2022 Received: (at 59838) by debbugs.gnu.org; 8 Dec 2022 10:28:50 +0000 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 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== 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) From: Manuel Giraud To: Eli Zaretskii Subject: Re: bug#59838: 30.0.50; [PATCH] Save history in GDB session In-Reply-To: <87mt805wnu.fsf@ledu-giraud.fr> (Manuel Giraud's message of "Tue, 06 Dec 2022 17:23:01 +0100") 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> Date: Thu, 08 Dec 2022 11:28:43 +0100 Message-ID: <87359qmbok.fsf@ledu-giraud.fr> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 59838 Cc: 59838@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) --=-=-= 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 --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Fri Dec 09 04:02:47 2022 Received: (at 59838) by debbugs.gnu.org; 9 Dec 2022 09:02:48 +0000 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 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== 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) From: Manuel Giraud To: Eli Zaretskii Subject: Re: bug#59838: 30.0.50; [PATCH] Save history in GDB session In-Reply-To: <87mt805wnu.fsf@ledu-giraud.fr> (Manuel Giraud's message of "Tue, 06 Dec 2022 17:23:01 +0100") 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> Date: Fri, 09 Dec 2022 10:02:40 +0100 Message-ID: <87pmctkkzz.fsf@ledu-giraud.fr> User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 59838 Cc: 59838@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) --=-=-= 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 --=-=-=-- From debbugs-submit-bounces@debbugs.gnu.org Sat Dec 10 08:40:44 2022 Received: (at 59838-done) by debbugs.gnu.org; 10 Dec 2022 13:40:45 +0000 Received: from localhost ([127.0.0.1]:42821 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p405s-0004tL-LU for submit@debbugs.gnu.org; Sat, 10 Dec 2022 08:40:44 -0500 Received: from eggs.gnu.org ([209.51.188.92]:43316) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p405q-0004tE-8t for 59838-done@debbugs.gnu.org; Sat, 10 Dec 2022 08:40:43 -0500 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1p405k-0007EK-DJ; Sat, 10 Dec 2022 08:40:36 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=HRXMsDx4v1ipowKTA2+KV3pHQ1QY8YHjgmo8lFK/r+g=; b=cUcoJysjqKee z8Y2VOa9x1m/gDERbDz8LJUZRMuz88/u+cUoJDt9Qylh1lAUcwdSHOfNZZbqrhEL7KFaFO6elYgaT tPtkI/BW6iDh6XldFyE9q8/6BdlOY+qhcJlGSt3aCOlfgz62k/XW+XCF2tBDnaXEDwPq77ANZVSkp 7CsdZbzVbDskuZLuRRj/Ugm+JVJwjZLfyLIA+B1AxthhLUdHpDobcS6UMeGU+UTP51rKpat8ecUGo JVcvtnNtVTojlzDuRKK6bIaQtKw/yyg3Mfr8AHfaoC4XV17Y4Jp3C4ifi9PFaTLQpf4jUmHmWIEiF SDZIF2Qm1NcPr+GCknnTCQ==; Received: from [87.69.77.57] (helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1p405j-0005fL-Sr; Sat, 10 Dec 2022 08:40:36 -0500 Date: Sat, 10 Dec 2022 15:40:32 +0200 Message-Id: <83y1rfwf5b.fsf@gnu.org> From: Eli Zaretskii To: Manuel Giraud In-Reply-To: <87pmctkkzz.fsf@ledu-giraud.fr> (message from Manuel Giraud on Fri, 09 Dec 2022 10:02:40 +0100) Subject: Re: bug#59838: 30.0.50; [PATCH] Save history in GDB session 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> <87pmctkkzz.fsf@ledu-giraud.fr> X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 59838-done Cc: 59838-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -3.3 (---) > From: Manuel Giraud > Cc: 59838@debbugs.gnu.org > Date: Fri, 09 Dec 2022 10:02:40 +0100 > > 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". Thanks, installed on the master branch. > Now I think we'll need a patch to gitignore the .gbd_history files > into the emacs directory. Yes, I think it's a good idea. From unknown Sat Jun 21 12:11:32 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Sun, 08 Jan 2023 12:24:06 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator