unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#7575: gdb command history saving
@ 2010-12-06 16:49 Pete Beardmore
  2010-12-07  1:28 ` Glenn Morris
  2022-01-31 16:51 ` Lars Ingebrigtsen
  0 siblings, 2 replies; 7+ messages in thread
From: Pete Beardmore @ 2010-12-06 16:49 UTC (permalink / raw)
  To: 7575

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.





^ permalink raw reply	[flat|nested] 7+ messages in thread

* bug#7575: gdb command history saving
  2010-12-06 16:49 bug#7575: gdb command history saving Pete Beardmore
@ 2010-12-07  1:28 ` Glenn Morris
  2011-03-09  9:02   ` Glenn Morris
  2011-06-02 17:58   ` Pete Beardmore
  2022-01-31 16:51 ` Lars Ingebrigtsen
  1 sibling, 2 replies; 7+ messages in thread
From: Glenn Morris @ 2010-12-07  1:28 UTC (permalink / raw)
  To: Pete Beardmore; +Cc: 7575

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.





^ permalink raw reply	[flat|nested] 7+ messages in thread

* bug#7575: gdb command history saving
  2010-12-07  1:28 ` Glenn Morris
@ 2011-03-09  9:02   ` Glenn Morris
  2011-06-02 17:58   ` Pete Beardmore
  1 sibling, 0 replies; 7+ messages in thread
From: Glenn Morris @ 2011-03-09  9:02 UTC (permalink / raw)
  To: 7575-done

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.





^ permalink raw reply	[flat|nested] 7+ messages in thread

* bug#7575: gdb command history saving
  2010-12-07  1:28 ` Glenn Morris
  2011-03-09  9:02   ` Glenn Morris
@ 2011-06-02 17:58   ` Pete Beardmore
  2011-06-02 21:50     ` Glenn Morris
  1 sibling, 1 reply; 7+ messages in thread
From: Pete Beardmore @ 2011-06-02 17:58 UTC (permalink / raw)
  To: 7575

>  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






^ permalink raw reply	[flat|nested] 7+ messages in thread

* bug#7575: gdb command history saving
  2011-06-02 17:58   ` Pete Beardmore
@ 2011-06-02 21:50     ` Glenn Morris
  0 siblings, 0 replies; 7+ messages in thread
From: Glenn Morris @ 2011-06-02 21:50 UTC (permalink / raw)
  To: Pete Beardmore; +Cc: 7575

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.





^ permalink raw reply	[flat|nested] 7+ messages in thread

* bug#7575: gdb command history saving
  2010-12-06 16:49 bug#7575: gdb command history saving Pete Beardmore
  2010-12-07  1:28 ` Glenn Morris
@ 2022-01-31 16:51 ` Lars Ingebrigtsen
  2022-03-01 15:46   ` Lars Ingebrigtsen
  1 sibling, 1 reply; 7+ messages in thread
From: Lars Ingebrigtsen @ 2022-01-31 16:51 UTC (permalink / raw)
  To: Pete Beardmore; +Cc: 7575

Pete Beardmore <pete.beardmore@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





^ permalink raw reply	[flat|nested] 7+ messages in thread

* bug#7575: gdb command history saving
  2022-01-31 16:51 ` Lars Ingebrigtsen
@ 2022-03-01 15:46   ` Lars Ingebrigtsen
  0 siblings, 0 replies; 7+ messages in thread
From: Lars Ingebrigtsen @ 2022-03-01 15:46 UTC (permalink / raw)
  To: Pete Beardmore; +Cc: 7575

Lars Ingebrigtsen <larsi@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





^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2022-03-01 15:46 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-12-06 16:49 bug#7575: gdb command history saving Pete Beardmore
2010-12-07  1:28 ` Glenn Morris
2011-03-09  9:02   ` Glenn Morris
2011-06-02 17:58   ` Pete Beardmore
2011-06-02 21:50     ` Glenn Morris
2022-01-31 16:51 ` Lars Ingebrigtsen
2022-03-01 15:46   ` Lars Ingebrigtsen

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).