This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH 5/7] PR gdb/15224 , Change the default set history filename to ~/.gdb_history.
- From: Pedro Alves <palves at redhat dot com>
- To: Eli Zaretskii <eliz at gnu dot org>
- Cc: mbilal at codesourcery dot com, gdb-patches at sourceware dot org, jan dot kratochvil at redhat dot com
- Date: Wed, 22 May 2013 20:39:18 +0100
- Subject: Re: [PATCH 5/7] PR gdb/15224 , Change the default set history filename to ~/.gdb_history.
- References: <51877A32 dot 1030503 at codesourcery dot com> <51877A99 dot 4060503 at codesourcery dot com> <51877B42 dot 7 at codesourcery dot com> <51877BC6 dot 6080007 at codesourcery dot com> <51877C76 dot 2000509 at codesourcery dot com> <518A0BA8 dot 9000703 at codesourcery dot com> <51936CAF dot 2090508 at codesourcery dot com> <51937A87 dot 2030403 at codesourcery dot com> <83ehd85q79 dot fsf at gnu dot org> <519CFF3D dot 4080001 at redhat dot com> <83bo82ucpv dot fsf at gnu dot org> <519D099F dot 7090101 at redhat dot com> <83a9nmu8l0 dot fsf at gnu dot org>
On 05/22/2013 08:18 PM, Eli Zaretskii wrote:
>> Scripts do have a means get the previous behavior. Simply adding
>> this to .gdbinit:
>
> But .gdbinit in the current directory is no longer read by default, so
> I can't, not without restoring the old behavior, which does involve
> using a command that will cause old GDB's to barf.
>
>> The reasoning for changing the default is that we (Pedro/Jan/Muhammad)
>> believe enabling history by default is a better default that having it
>> disabled by default, as currently.
>
> Another gratuitous incompatibility.
Sorry, but simply calling changes gratuitous when I've made an
effort to explain why I believe they're good doesn't help. :-/
The idea is that enabling the feature by default will expose
it to more users, who will benefit from it, most (educated-guessing
here, of course) not being aware GDB presently can already use
history from previous sessions.
>
>> Couple the fact that ".gdb_history"
>> is a dot/hidden file, with enabling history saving by default, and users
>> could end up with their filesystem littered with random hidden .gdb_history
>> files. I think GDB shouldn't do that by default. So in order to enable
>> history saving by default, we believe we should default to ~/.gdb_history
>> instead first. bash also defaults to saving history under $HOME, and I'd
>> think most other interactive programs/shell do so too. So it feels like
>> GDB is the odd one out here.
>
> Being the odd one out is not a reason good enough to change behavior
> that was the default for a long time.
The default has been to not save the history at all.
When weighing the pros and cons, I believe the pros outweigh the cons.
That's just my opinion, and I've just tried to clarify why I have it.
--
Pedro Alves