This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Fwd: [PATCH] Fix for PR gdb/15224 should "set history save on" by default


On Mon, 01 Apr 2013 13:33:18 +0200, Pedro Alves wrote:
> The commands issued in MI sessions aren't added to the history, as when the top
> level interpreter is MI, GDB doesn't use readline/history (look for add_history).

That's better than what I assumed.

This would mean 'set history save off' in GDB testsuite could be sufficient.


> It could be argued that commands executed through "-interpreter-exec console"
> should make it to the history.  Then we'd have the problem that cli
> commands that frontends issue because there are no MI alternatives would
> appear on the history.  But, we already have a solution for that -- the
> "server" command/prefix
> (http://sourceware.org/gdb/onlinedocs/gdb/Server-Prefix.html#Server-Prefix).

There is also needed backward compatibility with existing frontends.

The default for -i=mi could be made "set history save off" and new frontends
which properly recognize user commands vs. "server" commands could use during
initialization:
	-interpreter-exec console "set history save on"


> > I was thinking to just bind the default WRITE_HISTORY_P to
> > whether ~/.gdbinit is being read or not.
> 
> The history's filename is also tweakable with the GDBHISTFILE
> environment variable (there's HISTSIZE too; 'GDBHISTFILE= gdb' effectively
> disables history load/save).  Doesn't feel quite right to tie this to .gdbinit.

It matters how are the existing environments set up.  And by default neither
HISTSIZE nor GDBHISTFILE environment variables are set.

Binding it to ~/.gdbinit is really ugly but I did not have a better idea
compatible with existing GDB scripts/frontends/testsuites.


> One possible counter argument to flipping this on would that since history
> files are saved to the current directory by default, this has potential for
> littering users' directories with (hidden) .gdb_history files without the
> users noticing.  We should at least make that fact explicit in NEWS and
> perhaps make it prominent in the manual.

I see there should be also changed the default to:
	set history filename ~/.gdb_history

Otherwise it is a similar pain to ./.gdbinit, it is also non-standard to any
other normal application which use history files in $HOME, I do not find using
./.gdb_history by default as acceptable.


Jan


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]