This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
[patch 1/2] auto-load: Rename $ddir to $datadir
- From: Jan Kratochvil <jan dot kratochvil at redhat dot com>
- To: gdb-patches at sourceware dot org
- Date: Sat, 12 May 2012 16:47:14 +0200
- Subject: [patch 1/2] auto-load: Rename $ddir to $datadir
Hi,
when Doug suggested $ddir for data-directory, similar to $cdir, $pdir and
$sdir already in use, it made sense.
But currently I need to introduce also a variable for debug-file-directory and
having both $ddir and $debugdir valid in the same string seems to be confusing.
Therefore proposing to have $datadir and $debugdir instead in the next patch,
this patch is just a machanical rename $ddir -> $datadir.
I do not think it needs backward compatibiluty as $ddir has not yet been in
any GDB release.
Thanks,
Jan
gdb/
2012-05-12 Jan Kratochvil <jan.kratochvil@redhat.com>
Rename $ddir to $datadir.
* NEWS (--with-auto-load-dir): Rename $ddir to $datadir.
* auto-load.c (auto_load_safe_path_vec_update)
(auto_load_gdb_datadir_changed, auto_load_objfile_script): Likewise.
* configure: Regenerate.
* configure.ac (--with-auto-load-dir, --with-auto-load-safe-path):
Likewise. Remove the 'use $ddir' help string.
gdb/doc/
2012-05-12 Jan Kratochvil <jan.kratochvil@redhat.com>
Rename $ddir to $datadir.
* gdb.texinfo (Auto-loading, Auto-loading safe path)
(objfile-gdb.py file): Rename $ddir to $datadir.
--- a/gdb/NEWS
+++ b/gdb/NEWS
@@ -201,8 +201,8 @@ show debug auto-load
--with-auto-load-dir
Configure default value for the 'set auto-load scripts-directory'
- setting above. It defaults to '$ddir/auto-load', $ddir representing
- GDB's data directory (available via show data-directory).
+ setting above. It defaults to '$datadir/auto-load', $datadir
+ representing GDB's data directory (available via show data-directory).
--with-auto-load-safe-path
Configure default value for the 'set auto-load safe-path' setting
--- a/gdb/auto-load.c
+++ b/gdb/auto-load.c
@@ -174,13 +174,13 @@ auto_load_safe_path_vec_update (void)
char *ddir_subst, *expanded, *real_path;
ddir_subst = xstrdup (dir);
- substitute_path_component (&ddir_subst, "$ddir", gdb_datadir);
+ substitute_path_component (&ddir_subst, "$datadir", gdb_datadir);
expanded = tilde_expand (ddir_subst);
xfree (ddir_subst);
real_path = gdb_realpath (expanded);
/* Ensure the current entry is at least a valid path (therefore
- $ddir-expanded and tilde-expanded). */
+ $datadir-expanded and tilde-expanded). */
VEC_replace (char_ptr, auto_load_safe_path_vec, ix, expanded);
if (debug_auto_load)
@@ -212,7 +212,7 @@ auto_load_safe_path_vec_update (void)
}
}
-/* Variable gdb_datadir has been set. Update content depending on $ddir. */
+/* Variable gdb_datadir has been set. Update content depending on $datadir. */
static void
auto_load_gdb_datadir_changed (void)
@@ -691,7 +691,7 @@ auto_load_objfile_script (struct objfile *objfile,
for (ix = 0; VEC_iterate (char_ptr, vec, ix, dir); ++ix)
{
debugfile = xstrdup (dir);
- substitute_path_component (&debugfile, "$ddir", gdb_datadir);
+ substitute_path_component (&debugfile, "$datadir", gdb_datadir);
debugfile = xrealloc (debugfile, (strlen (debugfile)
+ strlen (filename) + 1));
--- a/gdb/configure
+++ b/gdb/configure
@@ -1487,11 +1487,10 @@ Optional Packages:
--with-relocated-sources=PATH
automatically relocate this path for source files
--with-auto-load-dir=PATH
- directories from which to load auto-loaded scripts,
- use '$ddir' for -data-directory [$ddir/auto-load]
+ directories from which to load auto-loaded scripts
+ [$datadir/auto-load]
--with-auto-load-safe-path=PATH
- directories safe to hold auto-loaded files, use
- $ddir for --with-gdb-datadir path
+ directories safe to hold auto-loaded files
[--with-auto-load-dir]
--without-auto-load-safe-path
do not restrict auto-loaded files locations
@@ -4971,10 +4970,10 @@ $as_echo_n "checking for default auto-load directory... " >&6; }
if test "${with_auto_load_dir+set}" = set; then :
withval=$with_auto_load_dir;
else
- with_auto_load_dir='$ddir/auto-load'
+ with_auto_load_dir='$datadir/auto-load'
fi
-escape_dir=`echo $with_auto_load_dir | sed 's/[$]ddir\>/\\\\\\\\\\\\&/g'`
+escape_dir=`echo $with_auto_load_dir | sed 's/[$]datadir\>/\\\\\\\\\\\\&/g'`
test "x$prefix" = xNONE && prefix="$ac_default_prefix"
test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
@@ -5001,7 +5000,7 @@ else
with_auto_load_safe_path="$with_auto_load_dir"
fi
-escape_dir=`echo $with_auto_load_safe_path | sed 's/[$]ddir\>/\\\\\\\\\\\\&/g'`
+escape_dir=`echo $with_auto_load_safe_path | sed 's/[$]datadir\>/\\\\\\\\\\\\&/g'`
test "x$prefix" = xNONE && prefix="$ac_default_prefix"
test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
--- a/gdb/configure.ac
+++ b/gdb/configure.ac
@@ -139,9 +139,9 @@ AS_HELP_STRING([--with-relocated-sources=PATH], [automatically relocate this pat
AC_MSG_CHECKING([for default auto-load directory])
AC_ARG_WITH(auto-load-dir,
AS_HELP_STRING([--with-auto-load-dir=PATH],
- [directories from which to load auto-loaded scripts, use '$ddir' for -data-directory @<:@$ddir/auto-load@:>@]),,
- [with_auto_load_dir='$ddir/auto-load'])
-escape_dir=`echo $with_auto_load_dir | sed 's/[[$]]ddir\>/\\\\\\\\\\\\&/g'`
+ [directories from which to load auto-loaded scripts @<:@$datadir/auto-load@:>@]),,
+ [with_auto_load_dir='$datadir/auto-load'])
+escape_dir=`echo $with_auto_load_dir | sed 's/[[$]]datadir\>/\\\\\\\\\\\\&/g'`
AC_DEFINE_DIR(AUTO_LOAD_DIR, escape_dir,
[Directories from which to load auto-loaded scripts.])
AC_MSG_RESULT([$with_auto_load_dir])
@@ -149,14 +149,14 @@ AC_MSG_RESULT([$with_auto_load_dir])
AC_MSG_CHECKING([for default auto-load safe-path])
AC_ARG_WITH(auto-load-safe-path,
AS_HELP_STRING([--with-auto-load-safe-path=PATH],
- [directories safe to hold auto-loaded files, use $ddir for --with-gdb-datadir path @<:@--with-auto-load-dir@:>@])
+ [directories safe to hold auto-loaded files @<:@--with-auto-load-dir@:>@])
AS_HELP_STRING([--without-auto-load-safe-path],
[do not restrict auto-loaded files locations]),
[if test "$with_auto_load_safe_path" = "no"; then
with_auto_load_safe_path="/"
fi],
[with_auto_load_safe_path="$with_auto_load_dir"])
-escape_dir=`echo $with_auto_load_safe_path | sed 's/[[$]]ddir\>/\\\\\\\\\\\\&/g'`
+escape_dir=`echo $with_auto_load_safe_path | sed 's/[[$]]datadir\>/\\\\\\\\\\\\&/g'`
AC_DEFINE_DIR(AUTO_LOAD_SAFE_PATH, escape_dir,
[Directories safe to hold auto-loaded files.])
AC_MSG_RESULT([$with_auto_load_safe_path])
--- a/gdb/doc/gdb.texinfo
+++ b/gdb/doc/gdb.texinfo
@@ -21098,9 +21098,9 @@ local-gdbinit: Auto-loading of .gdbinit script from current directory
is on.
python-scripts: Auto-loading of Python scripts is on.
safe-path: List of directories from which it is safe to auto-load files
- is $ddir/auto-load.
+ is $datadir/auto-load.
scripts-directory: List of directories from which to load auto-loaded scripts
- is $ddir/auto-load.
+ is $datadir/auto-load.
@end smallexample
@anchor{info auto-load}
@@ -21316,9 +21316,9 @@ get loaded:
$ ./gdb -q ./gdb
Reading symbols from /home/user/gdb/gdb...done.
warning: File "/home/user/gdb/gdb-gdb.gdb" auto-loading has been
- declined by your `auto-load safe-path' set to "$ddir/auto-load".
+ declined by your `auto-load safe-path' set to "$datadir/auto-load".
warning: File "/home/user/gdb/gdb-gdb.py" auto-loading has been
- declined by your `auto-load safe-path' set to "$ddir/auto-load".
+ declined by your `auto-load safe-path' set to "$datadir/auto-load".
@end smallexample
The list of trusted directories is controlled by the following commands:
@@ -21351,7 +21351,7 @@ host platform path separator in use.
@end table
This variable defaults to what @code{--with-auto-load-dir} has been configured
-to (@pxref{with-auto-load-dir}). @file{$ddir} substituation applies the same
+to (@pxref{with-auto-load-dir}). @file{$datadir} substituation applies the same
as for @xref{set auto-load scripts-directory}.
The default @code{set
auto-load safe-path} value can be also overriden by @value{GDBN} configuration
@@ -25581,14 +25581,14 @@ Each entry here needs to be covered also by the security setting
@code{set auto-load safe-path} (@pxref{set auto-load safe-path}).
@anchor{with-auto-load-dir}
-This variable defaults to @file{$ddir/auto-load}. The default @code{set
+This variable defaults to @file{$datadir/auto-load}. The default @code{set
auto-load safe-path} value can be also overriden by @value{GDBN} configuration
option @option{--with-auto-load-dir}.
-Any used string @file{$ddir} will get replaced by @var{data-directory} which is
-determined at @value{GDBN} startup (@pxref{Data Files}). @file{$ddir} must be
-be placed as a directory component --- either alone or delimited by @file{/} or
-@file{\} directory separators, depending on the host platform.
+Any used string @file{$datadir} will get replaced by @var{data-directory} which
+is determined at @value{GDBN} startup (@pxref{Data Files}). @file{$datadir}
+must be placed as a directory component --- either alone or delimited by
+@file{/} or @file{\} directory separators, depending on the host platform.
The list of directories uses path separator (@samp{:} on GNU and Unix
systems, @samp{;} on MS-Windows and MS-DOS) to separate directories, similarly