GNU bug report logs - #7575
gdb command history saving

Previous Next

Package: emacs;

Reported by: Pete Beardmore <pete.beardmore <at> msn.com>

Date: Mon, 6 Dec 2010 17:28:02 UTC

Severity: minor

Tags: moreinfo

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 7575 in the body.
You can then email your comments to 7575 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org:
bug#7575; Package emacs. (Mon, 06 Dec 2010 17:28:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Pete Beardmore <pete.beardmore <at> msn.com>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Mon, 06 Dec 2010 17:28:02 GMT) Full text and rfc822 format available.

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

From: Pete Beardmore <pete.beardmore <at> msn.com>
To: bug-gnu-emacs <at> gnu.org
Subject: gdb command history saving
Date: Mon, 6 Dec 2010 16:49:24 +0000
Hi.

When GDB is used through emacs, command history is not saved to my  
.gdbhist file on gdb 'quit'.

I use a MinGW/msys/bash environment. When gdb is used from the shell  
prompt, the settings in .gdbinit are sufficient to ensure ~/.gdbhist  
(or h:/install/MinGW/msys/1.0/home/pbeardm1/.gdbhist ..I've  
experimented with both) is successfully written to with the GDB  
command history.

When i use GNU emacs 23.2.1 (i386-mingw-nt5.1.2600) from this shell  
and start the debugger within, having typed a few arbitrary commands  
to populate the command history / ring, i quit the debugger and ..

..observe a time stamp change on the correct .gdbhist file ..BUT find  
its content exactly as it was previously i.e. with nothing appended.

I expect to see my last GDB commands written to the file.

Note: through emacs, this file is not read either ..which makes me  
think that i haven't tweaked 'input ring' settings to use this file as  
a 'ring source' or something. I enquired on the IRC channel and got  
tumbleweeds ..hence i call this a 'bug' (quotes) to leave room for the  
possibility of it being a trivial config issue!

Thanks.




Information forwarded to owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org:
bug#7575; Package emacs. (Tue, 07 Dec 2010 01:24:01 GMT) Full text and rfc822 format available.

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

From: Glenn Morris <rgm <at> gnu.org>
To: Pete Beardmore <pete.beardmore <at> msn.com>
Cc: 7575 <at> debbugs.gnu.org
Subject: Re: bug#7575: gdb command history saving
Date: Mon, 06 Dec 2010 20:28:51 -0500
Pete Beardmore wrote:

> ..observe a time stamp change on the correct .gdbhist file ..BUT find
> its content exactly as it was previously i.e. with nothing appended.
>
> I expect to see my last GDB commands written to the file.

It seemed to work for me.

> Note: through emacs, this file is not read either ..which makes me
> think that i haven't tweaked 'input ring' settings to use this file as
> a 'ring source' or something.

You could add something like the following to gdb-mode-hook:

  (setq comint-input-ring-file-name "~/.gdbhist")
  (comint-read-input-ring t)

shell-mode tries to do this by default; perhaps gdb-mode should do
similar.




Reply sent to Glenn Morris <rgm <at> gnu.org>:
You have taken responsibility. (Wed, 09 Mar 2011 09:03:01 GMT) Full text and rfc822 format available.

Notification sent to Pete Beardmore <pete.beardmore <at> msn.com>:
bug acknowledged by developer. (Wed, 09 Mar 2011 09:03:02 GMT) Full text and rfc822 format available.

Message #13 received at 7575-done <at> debbugs.gnu.org (full text, mbox):

From: Glenn Morris <rgm <at> gnu.org>
To: 7575-done <at> debbugs.gnu.org
Subject: Re: bug#7575: gdb command history saving
Date: Wed, 09 Mar 2011 04:02:34 -0500
Version 24.1

Glenn Morris wrote:

> You could add something like the following to gdb-mode-hook:
>
>   (setq comint-input-ring-file-name "~/.gdbhist")
>   (comint-read-input-ring t)
>
> shell-mode tries to do this by default; perhaps gdb-mode should do
> similar.

I've added this to M-x gdb.




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Wed, 06 Apr 2011 11:24:03 GMT) Full text and rfc822 format available.

bug unarchived. Request was from Pete Beardmore <pete.beardmore <at> msn.com> to control <at> debbugs.gnu.org. (Thu, 02 Jun 2011 17:16:02 GMT) Full text and rfc822 format available.

Information forwarded to owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org:
bug#7575; Package emacs. (Thu, 02 Jun 2011 18:06:01 GMT) Full text and rfc822 format available.

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

From: Pete Beardmore <pete.beardmore <at> msn.com>
To: 7575 <at> debbugs.gnu.org
Cc: Glenn Morris <rgm <at> gnu.org>
Subject: Re: bug#7575: gdb command history saving
Date: Thu, 2 Jun 2011 18:58:41 +0100
>  Glen Morris wrote:
>
>> Glen Morris wrote:
>>
>> You could add something like the following to gdb-mode-hook:
>>
>>   (setq comint-input-ring-file-name "~/.gdbhist")
>>   (comint-read-input-ring t)
>>
>> shell-mode tries to do this by default; perhaps gdb-mode should do
>> similar.
>
> I've added this to M-x gdb.

Hi, sorry for the late come back and thank you for the comments. Could  
i ask whether you tested a w32 emacs version evoked from a MinGW/Msys  
bash prompt? My GNU/Linux emacs gdb history works out of the box so i  
still think this is a bug, possibly to do with file encodings?!

As a workaround, i started with the gdb-mode-hook you provided (thank  
you) and added a few more comint settings..

(add-hook 'gdb-mode-hook '(lambda()
			(setq comint-input-ring-file-name "~/.gdbhist")
			(comint-read-input-ring t)
			(setq comint-input-ring-size 1000)
			(setq comint-input-ignoredups t)
		  ))

..but obviously this wouldn't solve the problem of not writing the  
commands back to the file after the session.

(add-hook 'kill-buffer-hook 'comint-write-input-ring)

..took care of the buffer being killed, but I also defined this advice  
to take care of quitting..

(defadvice gdb-send-item (before gdb-save-history first nil activate)
  "write input ring on quit"
  (if (equal (type-of item) 'string) ; avoid problems with some  
horrible, seemingly unprintable structures sent to this function..
    (if (string-match "^q\\(u\\|ui\\|uit\\)?$" item)
       (progn (comint-write-input-ring)
      (message "history file '%s' written" comint-input-ring-file-name)))))

Thanks,
Pete





Information forwarded to owner <at> debbugs.gnu.org, bug-gnu-emacs <at> gnu.org:
bug#7575; Package emacs. (Thu, 02 Jun 2011 21:52:01 GMT) Full text and rfc822 format available.

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

From: Glenn Morris <rgm <at> gnu.org>
To: Pete Beardmore <pete.beardmore <at> msn.com>
Cc: 7575 <at> debbugs.gnu.org
Subject: Re: bug#7575: gdb command history saving
Date: Thu, 02 Jun 2011 17:50:55 -0400
reopen 7575
stop

Pete Beardmore wrote:

> Hi, sorry for the late come back and thank you for the comments. Could
> i ask whether you tested a w32 emacs version evoked from a MinGW/Msys
> bash prompt? My GNU/Linux emacs gdb history works out of the box so i
> still think this is a bug, possibly to do with file encodings?!

No, sorry, I don't use MS Windows. I'll re-open this, since I see I only
addressed the second part of your initial report (about gdbhist not
being read), not the first part about it not being written.




Did not alter fixed versions and reopened. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Thu, 02 Jun 2011 21:52:02 GMT) Full text and rfc822 format available.

Message #26 received at 7575-quiet <at> debbugs.gnu.org (full text, mbox):

From: Glenn Morris <rgm <at> gnu.org>
To: 7575-quiet <at> debbugs.gnu.org
Subject: Re: bug#7575: gdb command history saving
Date: Mon, 24 Oct 2011 15:50:52 -0400
Glenn Morris wrote:

> No, sorry, I don't use MS Windows. I'll re-open this, since I see I only
> addressed the second part of your initial report (about gdbhist not
> being read), not the first part about it not being written.

http://debbugs.gnu.org/cgi/bugreport.cgi?bug=4437#30

   "Now Emacs uses GDB/MI, commands from the GUD buffer don't go into
    that history"

Not sure what this means, except that this feature isn't going to work.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#7575; Package emacs. (Mon, 31 Jan 2022 16:52:01 GMT) Full text and rfc822 format available.

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

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Pete Beardmore <pete.beardmore <at> msn.com>
Cc: 7575 <at> debbugs.gnu.org
Subject: Re: bug#7575: gdb command history saving
Date: Mon, 31 Jan 2022 17:51:04 +0100
Pete Beardmore <pete.beardmore <at> msn.com> writes:

> When i use GNU emacs 23.2.1 (i386-mingw-nt5.1.2600) from this shell
> and start the debugger within, having typed a few arbitrary commands
> to populate the command history / ring, i quit the debugger and ..
>
> ..observe a time stamp change on the correct .gdbhist file ..BUT find
> its content exactly as it was previously i.e. with nothing appended.

(I'm going through old bug reports that unfortunately weren't resolved
at the time.)

Do you still see this problem with more recent versions of
Emacs/Windows/gdb?

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




Added tag(s) moreinfo. Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Mon, 31 Jan 2022 16:52:02 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#7575; Package emacs. (Tue, 01 Mar 2022 15:47:01 GMT) Full text and rfc822 format available.

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

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Pete Beardmore <pete.beardmore <at> msn.com>
Cc: 7575 <at> debbugs.gnu.org
Subject: Re: bug#7575: gdb command history saving
Date: Tue, 01 Mar 2022 16:46:01 +0100
Lars Ingebrigtsen <larsi <at> gnus.org> writes:

> Do you still see this problem with more recent versions of
> Emacs/Windows/gdb?

More information was requested, but no response was given within a
month, so I'm closing this bug report.  If the problem still exists,
please respond to this email and we'll reopen the bug report.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




bug closed, send any further explanations to 7575 <at> debbugs.gnu.org and Pete Beardmore <pete.beardmore <at> msn.com> Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Tue, 01 Mar 2022 15:47:02 GMT) Full text and rfc822 format available.

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Wed, 30 Mar 2022 11:24:08 GMT) Full text and rfc822 format available.

This bug report was last modified 3 years and 96 days ago.

Previous Next


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