diff options
author | Jan Kratochvil <jan.kratochvil@redhat.com> | 2014-11-30 20:25:48 +0100 |
---|---|---|
committer | Jan Kratochvil <jan.kratochvil@redhat.com> | 2014-11-30 20:25:48 +0100 |
commit | f10c5b19e0d3f34cf36272bd9f038c19e6873275 (patch) | |
tree | 141bc24c401797017946460ebb50f7d3165ea75f /gdb/auto-load.c | |
parent | 413b59aecb4ab6b8a552d3b93a9dd7e981ab3c10 (diff) | |
download | gdb-f10c5b19e0d3f34cf36272bd9f038c19e6873275.zip gdb-f10c5b19e0d3f34cf36272bd9f038c19e6873275.tar.gz gdb-f10c5b19e0d3f34cf36272bd9f038c19e6873275.tar.bz2 |
Add add-auto-load-scripts-directory.
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.
Diffstat (limited to 'gdb/auto-load.c')
-rw-r--r-- | gdb/auto-load.c | 25 |
1 files changed, 25 insertions, 0 deletions
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."), _("\ |