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 03/29/2013 02:15 PM, Jan Kratochvil wrote:

> While that could be fixed in GDB testsuite the same problem will affect any
> GDB frontend.
> 
> Could you propose a patch compatible at least with existing front ends (like
> Eclipse CDT)?

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).

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).

> 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.

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.

-- 
Pedro Alves


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