Blame SOURCES/gdb-rhbz1163339-add-auto-load-scripts-directory.patch

01917d
Date: Thu, 13 Nov 2014 16:26:37 +0100
01917d
From: Jan Kratochvil <jan dot kratochvil at redhat dot com>
01917d
To: gdb-patches at sourceware dot org
01917d
Cc: Jakub Filak <jfilak at redhat dot com>
01917d
Subject: [patch] Add add-auto-load-scripts-directory
01917d
01917d
--jho1yZJdad60DJr+
01917d
Content-Type: text/plain; charset=us-ascii
01917d
Content-Disposition: inline
01917d
01917d
Hi,
01917d
01917d
there is already "add-auto-load-safe-path" which works
01917d
like "set auto-load safe-path" but in append mode.
01917d
01917d
There was missing an append equivalent for "set auto-load scripts-directory".
01917d
01917d
ABRT has directory /var/cache/abrt-di/ as an alternative one
01917d
to /usr/lib/debug/ . Therefore ABRT needs to use -iex parameters to add this
01917d
/var/cache/abrt-di/ directory as a first-class debuginfo directory.
01917d
Using absolute "set auto-load scripts-directory" would hard-code the path
01917d
possibly overriding local system directory additions; besides it would not be
01917d
nice anyway.
01917d
01917d
No regressions on {x86_64,x86_64-m32,i686}-fedora21-linux-gnu; although I have
01917d
seen some heavy regressions there today unrelated to this patch.
01917d
01917d
01917d
Thanks,
01917d
Jan
01917d
01917d
--jho1yZJdad60DJr+
01917d
Content-Type: text/plain; charset=us-ascii
01917d
Content-Disposition: inline; filename="addautoload.patch"
01917d
01917d
gdb/
01917d
2014-11-13  Jan Kratochvil  <jan.kratochvil@redhat.com>
01917d
01917d
	Add add-auto-load-scripts-directory.
01917d
	* NEWS (Changes since GDB 7.8): Add add-auto-load-scripts-directory.
01917d
	* auto-load.c (add_auto_load_dir): New function.
01917d
	(_initialize_auto_load): Install it.
01917d
01917d
gdb/doc/
01917d
2014-11-13  Jan Kratochvil  <jan.kratochvil@redhat.com>
01917d
01917d
	Add add-auto-load-scripts-directory.
01917d
	* gdb.texinfo (Auto-loading): Add add-auto-load-scripts-directory link.
01917d
	(objfile-gdbdotext file): Add add-auto-load-scripts-directory.
01917d
01917d
Index: gdb-7.6.1/gdb/NEWS
01917d
===================================================================
01917d
--- gdb-7.6.1.orig/gdb/NEWS
01917d
+++ gdb-7.6.1/gdb/NEWS
01917d
@@ -1,6 +1,12 @@
01917d
 		What has changed in GDB?
01917d
 	     (Organized release by release)
01917d
 
01917d
+* New commands:
01917d
+
01917d
+add-auto-load-scripts-directory directory
01917d
+  Add entries to the list of directories from which to load auto-loaded
01917d
+  scripts.
01917d
+
01917d
 * Newly installed $prefix/bin/gcore acts as a shell interface for the
01917d
   GDB command gcore.
01917d
 
01917d
Index: gdb-7.6.1/gdb/auto-load.c
01917d
===================================================================
01917d
--- gdb-7.6.1.orig/gdb/auto-load.c
01917d
+++ gdb-7.6.1/gdb/auto-load.c
01917d
@@ -298,6 +298,22 @@ Use 'set auto-load safe-path /' for disa
01917d
   auto_load_safe_path_vec_update ();
01917d
 }
01917d
 
01917d
+/* "add-auto-load-scripts-directory" command for the auto_load_dir configuration
01917d
+   variable.  */
01917d
+
01917d
+static void
01917d
+add_auto_load_dir (char *args, int from_tty)
01917d
+{
01917d
+  char *s;
01917d
+
01917d
+  if (args == NULL || *args == 0)
01917d
+    error (_("Directory argument required."));
01917d
+
01917d
+  s = xstrprintf ("%s%c%s", auto_load_dir, DIRNAME_SEPARATOR, args);
01917d
+  xfree (auto_load_dir);
01917d
+  auto_load_dir = s;
01917d
+}
01917d
+
01917d
 /* Implementation for filename_is_in_pattern overwriting the caller's FILENAME
01917d
    and PATTERN.  */
01917d
 
01917d
@@ -1295,6 +1311,15 @@ access the current full list setting."),
01917d
 		 &cmdlist);
01917d
   set_cmd_completer (cmd, filename_completer);
01917d
 
01917d
+  cmd = add_cmd ("add-auto-load-scripts-directory", class_support,
01917d
+		 add_auto_load_dir,
01917d
+		 _("Add entries to the list of directories from which to load "
01917d
+		   "auto-loaded scripts.\n\
01917d
+See the commands 'set auto-load scripts-directory' and\n\
01917d
+'show auto-load scripts-directory' to access the current full list setting."),
01917d
+		 &cmdlist);
01917d
+  set_cmd_completer (cmd, filename_completer);
01917d
+
01917d
   add_setshow_boolean_cmd ("auto-load", class_maintenance,
01917d
 			   &debug_auto_load, _("\
01917d
 Set auto-load verifications debugging."), _("\
01917d
Index: gdb-7.6.1/gdb/doc/gdb.texinfo
01917d
===================================================================
01917d
--- gdb-7.6.1.orig/gdb/doc/gdb.texinfo
01917d
+++ gdb-7.6.1/gdb/doc/gdb.texinfo
01917d
@@ -21929,6 +21929,8 @@ These are @value{GDBN} control commands
01917d
 @tab Control for @value{GDBN} auto-loaded scripts location.
01917d
 @item @xref{show auto-load scripts-directory}.
01917d
 @tab Show @value{GDBN} auto-loaded scripts location.
01917d
+@item @xref{add-auto-load-scripts-directory}.
01917d
+@tab Add directory for auto-loaded scripts location list.
01917d
 @item @xref{set auto-load local-gdbinit}.
01917d
 @tab Control for init file in the current directory.
01917d
 @item @xref{show auto-load local-gdbinit}.
01917d
@@ -27213,6 +27215,12 @@ to the @env{PATH} environment variable.
01917d
 @kindex show auto-load scripts-directory
01917d
 @item show auto-load scripts-directory
01917d
 Show @value{GDBN} auto-loaded scripts location.
01917d
+
01917d
+@anchor{add-auto-load-scripts-directory}
01917d
+@kindex add-auto-load-scripts-directory
01917d
+@item add-auto-load-scripts-directory @r{[}@var{directories}@r{]}
01917d
+Add an entry (or list of entries) to the list of auto-loaded scripts locations.
01917d
+Multiple entries may be delimited by the host platform path separator in use.
01917d
 @end table
01917d
 
01917d
 @value{GDBN} does not track which files it has already auto-loaded this way.