]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
Add add-auto-load-scripts-directory.
authorJan Kratochvil <jan.kratochvil@redhat.com>
Sun, 30 Nov 2014 19:25:48 +0000 (20:25 +0100)
committerJan Kratochvil <jan.kratochvil@redhat.com>
Sun, 30 Nov 2014 19:25:48 +0000 (20:25 +0100)
There is already "add-auto-load-safe-path" which works
like "set auto-load safe-path" but in append mode.

There was missing an append equivalent for "set auto-load scripts-directory".

ABRT has directory /var/cache/abrt-di/ as an alternative one
to /usr/lib/debug/ . Therefore ABRT needs to use -iex parameters to add this
/var/cache/abrt-di/ directory as a first-class debuginfo directory.
Using absolute "set auto-load scripts-directory" would hard-code the path
possibly overriding local system directory additions; besides it would not be
nice anyway.

gdb/ChangeLog
2014-11-30  Jan Kratochvil  <jan.kratochvil@redhat.com>

Add add-auto-load-scripts-directory.
* NEWS (Changes since GDB 7.8): Add add-auto-load-scripts-directory.
* auto-load.c (add_auto_load_dir): New function.
(_initialize_auto_load): Install it.

gdb/doc/ChangeLog
2014-11-30  Jan Kratochvil  <jan.kratochvil@redhat.com>

Add add-auto-load-scripts-directory.
* gdb.texinfo (Auto-loading): Add add-auto-load-scripts-directory link.
(objfile-gdbdotext file): Add add-auto-load-scripts-directory.

gdb/ChangeLog
gdb/NEWS
gdb/auto-load.c
gdb/doc/ChangeLog
gdb/doc/gdb.texinfo

index f706f29602d5c644afb157ad1f53ad1d8432af8b..e2dbe0a935030925aebb565abae8ec67aedf6a1c 100644 (file)
@@ -1,3 +1,10 @@
+2014-11-30  Jan Kratochvil  <jan.kratochvil@redhat.com>
+
+       Add add-auto-load-scripts-directory.
+       * NEWS (Changes since GDB 7.8): Add add-auto-load-scripts-directory.
+       * auto-load.c (add_auto_load_dir): New function.
+       (_initialize_auto_load): Install it.
+
 2014-11-30  Martin Galvan  <martin.galvan@tallertechnologies.com>  (tiny patch, obvious)
 
        Pushed by Joel Brobecker  <brobecker@adacore.com>.
index d6a8b6109bfc2c888fa910646ca69954f35ca285..d38266f2508e36a6d5a5e96219dd978d6e724739 100644 (file)
--- a/gdb/NEWS
+++ b/gdb/NEWS
 queue-signal signal-name-or-number
   Queue a signal to be delivered to the thread when it is resumed.
 
+add-auto-load-scripts-directory directory
+  Add entries to the list of directories from which to load auto-loaded
+  scripts.
+
 * On resume, GDB now always passes the signal the program had stopped
   for to the thread the signal was sent to, even if the user changed
   threads before resuming.  Previously GDB would often (but not
index 0f5973928a2267cebfb8142499354c8ec63576dc..5906579fcac8aebfa17792e89d6b4e518e4dfe0c 100644 (file)
@@ -317,6 +317,22 @@ Use 'set auto-load safe-path /' for disabling the auto-load safe-path security.\
   auto_load_safe_path_vec_update ();
 }
 
+/* "add-auto-load-scripts-directory" command for the auto_load_dir configuration
+   variable.  */
+
+static void
+add_auto_load_dir (char *args, int from_tty)
+{
+  char *s;
+
+  if (args == NULL || *args == 0)
+    error (_("Directory argument required."));
+
+  s = xstrprintf ("%s%c%s", auto_load_dir, DIRNAME_SEPARATOR, args);
+  xfree (auto_load_dir);
+  auto_load_dir = s;
+}
+
 /* Implementation for filename_is_in_pattern overwriting the caller's FILENAME
    and PATTERN.  */
 
@@ -1526,6 +1542,15 @@ access the current full list setting."),
                 &cmdlist);
   set_cmd_completer (cmd, filename_completer);
 
+  cmd = add_cmd ("add-auto-load-scripts-directory", class_support,
+                add_auto_load_dir,
+                _("Add entries to the list of directories from which to load "
+                  "auto-loaded scripts.\n\
+See the commands 'set auto-load scripts-directory' and\n\
+'show auto-load scripts-directory' to access the current full list setting."),
+                &cmdlist);
+  set_cmd_completer (cmd, filename_completer);
+
   add_setshow_boolean_cmd ("auto-load", class_maintenance,
                           &debug_auto_load, _("\
 Set auto-load verifications debugging."), _("\
index fcc18ebe924f4a2f2c5716d2936ff3f496b241b0..3b27128e72e78e13256ff8da900abc5c7d3a6f58 100644 (file)
@@ -1,3 +1,9 @@
+2014-11-30  Jan Kratochvil  <jan.kratochvil@redhat.com>
+
+       Add add-auto-load-scripts-directory.
+       * gdb.texinfo (Auto-loading): Add add-auto-load-scripts-directory link.
+       (objfile-gdbdotext file): Add add-auto-load-scripts-directory.
+
 2014-11-30  Jan Kratochvil  <jan.kratochvil@redhat.com>
 
        * gdb.texinfo (Auto-loading safe path): Fix add-auto-load-safe-path
index c475686518bd211517da5d944f66a59278e4e3e4..670c36998eaf7d71483caa2b0d9eacec7827b6a0 100644 (file)
@@ -22414,6 +22414,8 @@ These are @value{GDBN} control commands for the auto-loading:
 @tab Control for @value{GDBN} auto-loaded scripts location.
 @item @xref{show auto-load scripts-directory}.
 @tab Show @value{GDBN} auto-loaded scripts location.
+@item @xref{add-auto-load-scripts-directory}.
+@tab Add directory for auto-loaded scripts location list.
 @item @xref{set auto-load local-gdbinit}.
 @tab Control for init file in the current directory.
 @item @xref{show auto-load local-gdbinit}.
@@ -23713,6 +23715,12 @@ to the @env{PATH} environment variable.
 @kindex show auto-load scripts-directory
 @item show auto-load scripts-directory
 Show @value{GDBN} auto-loaded scripts location.
+
+@anchor{add-auto-load-scripts-directory}
+@kindex add-auto-load-scripts-directory
+@item add-auto-load-scripts-directory @r{[}@var{directories}@dots{}@r{]}
+Add an entry (or list of entries) to the list of auto-loaded scripts locations.
+Multiple entries may be delimited by the host platform path separator in use.
 @end table
 
 @value{GDBN} does not track which files it has already auto-loaded this way.