From 202cbf1c525d01ed5d394d879de5d88ae3d00da1 Mon Sep 17 00:00:00 2001 From: Jan Kratochvil Date: Mon, 2 Jul 2012 10:57:34 +0000 Subject: gdb/ Support shell wildcards for 'set auto-load safe-path'. * auto-load.c: Include fnmatch.h. (filename_is_in_dir): Rename to ... (filename_is_in_pattern_1, filename_is_in_pattern): ... here and split it. Update function comment. Rename dir_len to pattern_len. New variables filename_len, pattern and filename. Add more DEBUG_AUTO_LOAD messages. Use gdb_filename_fnmatch. (filename_is_in_auto_load_safe_path_vec): Rename variable dir to pattern. (_initialize_auto_load): Extend the "set auto-load safe-path" help text. * defs.h (gdb_filename_fnmatch): New declaration. * utils.c: Include fnmatch.h. (gdb_filename_fnmatch): New function. gdb/doc/ * gdb.texinfo (Auto-loading safe path): Note the shell wildcard possibility. --- gdb/doc/ChangeLog | 5 +++++ gdb/doc/gdb.texinfo | 4 ++++ 2 files changed, 9 insertions(+) (limited to 'gdb/doc') diff --git a/gdb/doc/ChangeLog b/gdb/doc/ChangeLog index 4ab5dec..2a398fe 100644 --- a/gdb/doc/ChangeLog +++ b/gdb/doc/ChangeLog @@ -1,3 +1,8 @@ +2012-07-02 Jan Kratochvil + + * gdb.texinfo (Auto-loading safe path): Note the shell wildcard + possibility. + 2012-06-29 Tom Tromey * gdb.texinfo (Index Section Format): Update for version 7. diff --git a/gdb/doc/gdb.texinfo b/gdb/doc/gdb.texinfo index 852409e..a01ce9a 100644 --- a/gdb/doc/gdb.texinfo +++ b/gdb/doc/gdb.texinfo @@ -21451,6 +21451,7 @@ As the files of inferior can come from untrusted source (such as submitted by an application user) @value{GDBN} does not always load any files automatically. @value{GDBN} provides the @samp{set auto-load safe-path} setting to list directories trusted for loading files not explicitly requested by user. +Each directory can also be a shell wildcard pattern. If the path is not set properly you will see a warning and the file will not get loaded: @@ -21474,6 +21475,9 @@ The list of trusted directories is controlled by the following commands: @item set auto-load safe-path @r{[}@var{directories}@r{]} Set the list of directories (and their subdirectories) trusted for automatic loading and execution of scripts. You can also enter a specific trusted file. +Each directory can also be a shell wildcard pattern; wildcards do not match +directory separator - see @code{FNM_PATHNAME} for system function @code{fnmatch} +(@pxref{Wildcard Matching, fnmatch, , libc, GNU C Library Reference Manual}). If you omit @var{directories}, @samp{auto-load safe-path} will be reset to its default value as specified during @value{GDBN} compilation. -- cgit v1.1