Provide $ddir substitution for --with-auto-load-safe-path.
	* NEWS (--with-auto-load-safe-path, --without-auto-load-safe-path): New
	entries.
	* auto-load.c: Include observer.h.
	(auto_load_safe_path_vec_update): Call substitute_path_component for
	each component.  New variable ddir_subst.
	(auto_load_gdb_datadir_changed): New function.
	(set_auto_load_safe_path): Rename DEFAULT_AUTO_LOAD_SAFE_PATH to
	AUTO_LOAD_SAFE_PATH.  New comment.
	(_initialize_auto_load): Rename DEFAULT_AUTO_LOAD_SAFE_PATH to
	AUTO_LOAD_SAFE_PATH.  Install auto_load_gdb_datadir_changed.
	* config.in: Regenerate.
	* configure: Regenerate.
	* configure.ac (--auto-load-safe-path): Rename
	DEFAULT_AUTO_LOAD_SAFE_PATH to AUTO_LOAD_SAFE_PATH.  Default to
	GDB_DATADIR/auto-load.
	* defs.h (substitute_path_component): New declaration.
	* top.c: Include observer.h.
	(set_gdb_datadir): New function.
	(init_main): Install it for "set data-directory".
	* utils.c (substitute_path_component): New function.

gdb/doc/
	Provide $ddir substitution for --with-auto-load-safe-path.
	* gdb.texinfo (Auto-loading): Replace /usr/local by $ddir/auto-load.
	(Auto-loading safe path): Likewise.  Mention the default value,
	$ddir substitution, --with-auto-load-safe-path and
	--without-auto-load-safe-path.
	* observer.texi (gdb_datadir_changed): New.
This commit is contained in:
Jan Kratochvil
2012-05-11 18:13:26 +00:00
parent b09aca3aa7
commit 6dea1fbd79
12 changed files with 162 additions and 26 deletions

View File

@ -47,6 +47,7 @@
#include "gdbthread.h"
#include "python/python.h"
#include "interps.h"
#include "observer.h"
/* readline include files. */
#include "readline/readline.h"
@ -1559,6 +1560,15 @@ show_exec_done_display_p (struct ui_file *file, int from_tty,
"asynchronous execution commands is %s.\n"),
value);
}
/* "set" command for the gdb_datadir configuration variable. */
static void
set_gdb_datadir (char *args, int from_tty, struct cmd_list_element *c)
{
observer_notify_gdb_datadir_changed ();
}
static void
init_main (void)
{
@ -1666,7 +1676,7 @@ Use \"on\" to enable the notification, and \"off\" to disable it."),
_("Show GDB's data directory."),
_("\
When set, GDB uses the specified path to search for data files."),
NULL, NULL,
set_gdb_datadir, NULL,
&setlist,
&showlist);
}