Bug 16136 - Make users aware of the ./.gdb_history -> ~/.gdb_history default command history file change.
Summary: Make users aware of the ./.gdb_history -> ~/.gdb_history default command hist...
Status: NEW
Alias: None
Product: gdb
Classification: Unclassified
Component: gdb (show other bugs)
Version: HEAD
: P2 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks: 15224
  Show dependency treegraph
 
Reported: 2013-11-07 10:58 UTC by Pedro Alves
Modified: 2013-11-07 11:47 UTC (History)
0 users

See Also:
Host:
Target:
Build:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Pedro Alves 2013-11-07 10:58:19 UTC
GDB always reads the command history file, even if history save is
off.  Currently, the default history filename is ./.gdb_history.  This
has been a long time default.  If we switch the default to
~/.gdb_history, there'll be lots of users with lots of ./.gdb_history
files that will now silently no longer be read in.

So, there are two possible fronts that could be considered here:

 - backwards compatibility
 - user awareness of the change

One idea to maintain backwards compatibility would be to check if
./.gdb_history, if it exists.  If the history filename set actually
points elsewhere, GDB would tell the user that history is saved in
wherever the user has set it to (~/.gdb_history by default), and ask
her whether to read/save there or to .gdb_history.  A variant of this
would be to always read from ./.gdb_history if it exists, and ask
whether to save there, or to the user's configured location
(~/.gdb_history by default).

Or, we could tackle only the awareness part.  We could make gdb check
if a ./.gdbinit file exists and warn if the history filename actually
points elsewhere, with a hint on how to load that history file, but
not actually load it.  We have precedent for something like that in
windows-nat.c:_initialize_check_for_gdb_ini.

IMO, the former is more complexity (and possible confusion) than
necessary.  I think I prefer the simpler idea of tackling only
awareness.
Comment 1 Pedro Alves 2013-11-07 11:47:21 UTC
To clarify, this:

> One idea to maintain backwards compatibility would be to check if
> ./.gdb_history, if it exists.  If the history filename set actually

should have read:

 One idea to maintain backwards compatibility would be to check if
 ./.gdb_history exists.  If so, and if the history filename set actually
 ...