public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
* [patch] Add add-auto-load-scripts-directory
@ 2014-11-13 15:26 Jan Kratochvil
  2014-11-30 14:57 ` Joel Brobecker
  2014-11-30 18:12 ` doc ping: " Jan Kratochvil
  0 siblings, 2 replies; 5+ messages in thread
From: Jan Kratochvil @ 2014-11-13 15:26 UTC (permalink / raw)
  To: gdb-patches; +Cc: Jakub Filak

[-- Attachment #1: Type: text/plain, Size: 721 bytes --]

Hi,

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.

No regressions on {x86_64,x86_64-m32,i686}-fedora21-linux-gnu; although I have
seen some heavy regressions there today unrelated to this patch.


Thanks,
Jan

[-- Attachment #2: addautoload.patch --]
[-- Type: text/plain, Size: 3703 bytes --]

gdb/
2014-11-13  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/
2014-11-13  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.

diff --git a/gdb/NEWS b/gdb/NEWS
index 649c29e..6843482 100644
--- a/gdb/NEWS
+++ b/gdb/NEWS
@@ -27,6 +27,10 @@
 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
diff --git a/gdb/auto-load.c b/gdb/auto-load.c
index 0f59739..5906579 100644
--- a/gdb/auto-load.c
+++ b/gdb/auto-load.c
@@ -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."), _("\
diff --git a/gdb/doc/gdb.texinfo b/gdb/doc/gdb.texinfo
index 15c2908..2d382ba 100644
--- a/gdb/doc/gdb.texinfo
+++ b/gdb/doc/gdb.texinfo
@@ -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}@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.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [patch] Add add-auto-load-scripts-directory
  2014-11-13 15:26 [patch] Add add-auto-load-scripts-directory Jan Kratochvil
@ 2014-11-30 14:57 ` Joel Brobecker
  2014-11-30 19:27   ` [commit] " Jan Kratochvil
  2014-11-30 18:12 ` doc ping: " Jan Kratochvil
  1 sibling, 1 reply; 5+ messages in thread
From: Joel Brobecker @ 2014-11-30 14:57 UTC (permalink / raw)
  To: Jan Kratochvil; +Cc: gdb-patches, Jakub Filak

I agree it makes sense to have a command to appent to the current
scripts path.

> gdb/
> 2014-11-13  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.

The code part of the patch are approved.

> gdb/doc/
> 2014-11-13  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.

-- 
Joel

^ permalink raw reply	[flat|nested] 5+ messages in thread

* doc ping: [patch] Add add-auto-load-scripts-directory
  2014-11-13 15:26 [patch] Add add-auto-load-scripts-directory Jan Kratochvil
  2014-11-30 14:57 ` Joel Brobecker
@ 2014-11-30 18:12 ` Jan Kratochvil
  2014-11-30 18:27   ` Eli Zaretskii
  1 sibling, 1 reply; 5+ messages in thread
From: Jan Kratochvil @ 2014-11-30 18:12 UTC (permalink / raw)
  To: gdb-patches; +Cc: Jakub Filak, Eli Zaretskii

[-- Attachment #1: Type: text/plain, Size: 786 bytes --]

ping:
On Thu, 13 Nov 2014 16:26:37 +0100, Jan Kratochvil wrote:

Hi,

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.

No regressions on {x86_64,x86_64-m32,i686}-fedora21-linux-gnu; although I have
seen some heavy regressions there today unrelated to this patch.


Thanks,
Jan

[-- Attachment #2: addautoload.patch --]
[-- Type: text/plain, Size: 3703 bytes --]

gdb/
2014-11-13  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/
2014-11-13  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.

diff --git a/gdb/NEWS b/gdb/NEWS
index 649c29e..6843482 100644
--- a/gdb/NEWS
+++ b/gdb/NEWS
@@ -27,6 +27,10 @@
 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
diff --git a/gdb/auto-load.c b/gdb/auto-load.c
index 0f59739..5906579 100644
--- a/gdb/auto-load.c
+++ b/gdb/auto-load.c
@@ -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."), _("\
diff --git a/gdb/doc/gdb.texinfo b/gdb/doc/gdb.texinfo
index 15c2908..2d382ba 100644
--- a/gdb/doc/gdb.texinfo
+++ b/gdb/doc/gdb.texinfo
@@ -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}@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.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: doc ping: [patch] Add add-auto-load-scripts-directory
  2014-11-30 18:12 ` doc ping: " Jan Kratochvil
@ 2014-11-30 18:27   ` Eli Zaretskii
  0 siblings, 0 replies; 5+ messages in thread
From: Eli Zaretskii @ 2014-11-30 18:27 UTC (permalink / raw)
  To: Jan Kratochvil; +Cc: gdb-patches, jfilak

> Date: Sun, 30 Nov 2014 19:12:44 +0100
> From: Jan Kratochvil <jan.kratochvil@redhat.com>
> Cc: Jakub Filak <jfilak@redhat.com>, Eli Zaretskii <eliz@gnu.org>
> 
> +@item add-auto-load-scripts-directory @r{[}@var{directories}@r{]}

Please add @dots{} after @var{directories}.

The documentation parts are OK with that change.

Thanks.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [commit] [patch] Add add-auto-load-scripts-directory
  2014-11-30 14:57 ` Joel Brobecker
@ 2014-11-30 19:27   ` Jan Kratochvil
  0 siblings, 0 replies; 5+ messages in thread
From: Jan Kratochvil @ 2014-11-30 19:27 UTC (permalink / raw)
  To: Joel Brobecker, Eli Zaretskii; +Cc: gdb-patches, Jakub Filak

On Sun, 30 Nov 2014 15:56:47 +0100, Joel Brobecker wrote:
> The code part of the patch are approved.

On Sun, 30 Nov 2014 19:27:40 +0100, Eli Zaretskii wrote:
> The documentation parts are OK with that change.

Checked in:
	f10c5b19e0d3f34cf36272bd9f038c19e6873275


Thanks,
Jan

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2014-11-30 19:27 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-11-13 15:26 [patch] Add add-auto-load-scripts-directory Jan Kratochvil
2014-11-30 14:57 ` Joel Brobecker
2014-11-30 19:27   ` [commit] " Jan Kratochvil
2014-11-30 18:12 ` doc ping: " Jan Kratochvil
2014-11-30 18:27   ` Eli Zaretskii

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).