GNU bug report logs - #59838
30.0.50; [PATCH] Save history in GDB session

Previous Next

Package: emacs;

Reported by: Manuel Giraud <manuel <at> ledu-giraud.fr>

Date: Mon, 5 Dec 2022 16:54:01 UTC

Severity: normal

Tags: patch

Found in version 30.0.50

Done: Eli Zaretskii <eliz <at> gnu.org>

Bug is archived. No further changes may be made.

Full log


Message #14 received at 59838 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Manuel Giraud <manuel <at> ledu-giraud.fr>
Cc: 59838 <at> debbugs.gnu.org
Subject: Re: bug#59838: 30.0.50; [PATCH] Save history in GDB session
Date: Mon, 05 Dec 2022 21:35:25 +0200
> From: Manuel Giraud <manuel <at> ledu-giraud.fr>
> Cc: 59838 <at> debbugs.gnu.org
> Date: Mon, 05 Dec 2022 18:53:33 +0100
> 
> Eli Zaretskii <eliz <at> gnu.org> writes:
> 
> >> From: Manuel Giraud <manuel <at> ledu-giraud.fr>
> >> 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.




This bug report was last modified 2 years and 165 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.