aboutsummaryrefslogtreecommitdiff
path: root/gdb/auto-load.h
diff options
context:
space:
mode:
authorSimon Marchi <simon.marchi@polymtl.ca>2021-01-13 11:44:24 -0500
committerSimon Marchi <simon.marchi@polymtl.ca>2021-01-13 11:44:24 -0500
commit5e12f48ffbf5eba4524fdbae341f091c7cd0cb72 (patch)
tree984056816a088262765391f58e72580130f584a4 /gdb/auto-load.h
parent54ca900277f2abe483f6c747452a528a0e804b62 (diff)
downloadgdb-5e12f48ffbf5eba4524fdbae341f091c7cd0cb72.zip
gdb-5e12f48ffbf5eba4524fdbae341f091c7cd0cb72.tar.gz
gdb-5e12f48ffbf5eba4524fdbae341f091c7cd0cb72.tar.bz2
gdb: bool-ify file_is_auto_load_safe
Make it return bool and change the advice_printed to bool as well. Move doc to header file. gdb/ChangeLog: * auto-load.h (file_is_auto_load_safe): Change return type to bool, move comment here. * auto-load.c (file_is_auto_load_safe): Change return type and advice_printed to bool. Move comment to header. Change-Id: Ia7395e7cea8880377800240833316e4be5251d49
Diffstat (limited to 'gdb/auto-load.h')
-rw-r--r--gdb/auto-load.h12
1 files changed, 10 insertions, 2 deletions
diff --git a/gdb/auto-load.h b/gdb/auto-load.h
index 58cd993..c644b46 100644
--- a/gdb/auto-load.h
+++ b/gdb/auto-load.h
@@ -44,8 +44,16 @@ extern struct cmd_list_element **auto_load_set_cmdlist_get (void);
extern struct cmd_list_element **auto_load_show_cmdlist_get (void);
extern struct cmd_list_element **auto_load_info_cmdlist_get (void);
-extern int file_is_auto_load_safe (const char *filename,
- const char *debug_fmt, ...)
+/* Return true if FILENAME is located in one of the directories of
+ AUTO_LOAD_SAFE_PATH. Otherwise call warning and return false. FILENAME does
+ not have to be an absolute path.
+
+ Existence of FILENAME is not checked. Function will still give a warning
+ even if the caller would quietly skip non-existing file in unsafe
+ directory. */
+
+extern bool file_is_auto_load_safe (const char *filename,
+ const char *debug_fmt, ...)
ATTRIBUTE_PRINTF (2, 3);
extern int auto_load_gdb_scripts_enabled