auto-load.h 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. /* GDB routines for supporting auto-loaded scripts.
  2. Copyright (C) 2012-2022 Free Software Foundation, Inc.
  3. This file is part of GDB.
  4. This program is free software; you can redistribute it and/or modify
  5. it under the terms of the GNU General Public License as published by
  6. the Free Software Foundation; either version 3 of the License, or
  7. (at your option) any later version.
  8. This program is distributed in the hope that it will be useful,
  9. but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  11. GNU General Public License for more details.
  12. You should have received a copy of the GNU General Public License
  13. along with this program. If not, see <http://www.gnu.org/licenses/>. */
  14. #ifndef AUTO_LOAD_H
  15. #define AUTO_LOAD_H 1
  16. struct objfile;
  17. struct program_space;
  18. struct auto_load_pspace_info;
  19. struct extension_language_defn;
  20. namespace gdb {
  21. namespace observers {
  22. struct token;
  23. } /* namespace observers */
  24. } /* namespace gdb */
  25. /* Value of the 'set debug auto-load' configuration variable. */
  26. extern bool debug_auto_load;
  27. /* Print an "auto-load" debug statement. */
  28. #define auto_load_debug_printf(fmt, ...) \
  29. debug_prefixed_printf_cond (debug_auto_load, "auto-load", fmt, ##__VA_ARGS__)
  30. extern bool global_auto_load;
  31. extern bool auto_load_local_gdbinit;
  32. extern char *auto_load_local_gdbinit_pathname;
  33. extern bool auto_load_local_gdbinit_loaded;
  34. /* Token used for the auto_load_new_objfile observer, so other observers can
  35. specify it as a dependency. */
  36. extern gdb::observers::token auto_load_new_objfile_observer_token;
  37. extern struct auto_load_pspace_info *
  38. get_auto_load_pspace_data_for_loading (struct program_space *pspace);
  39. extern void auto_load_objfile_script (struct objfile *objfile,
  40. const struct extension_language_defn *);
  41. extern void load_auto_scripts_for_objfile (struct objfile *objfile);
  42. extern char auto_load_info_scripts_pattern_nl[];
  43. extern void auto_load_info_scripts (const char *pattern, int from_tty,
  44. const struct extension_language_defn *);
  45. extern struct cmd_list_element **auto_load_set_cmdlist_get (void);
  46. extern struct cmd_list_element **auto_load_show_cmdlist_get (void);
  47. extern struct cmd_list_element **auto_load_info_cmdlist_get (void);
  48. /* Return true if FILENAME is located in one of the directories of
  49. AUTO_LOAD_SAFE_PATH. Otherwise call warning and return false. FILENAME does
  50. not have to be an absolute path.
  51. Existence of FILENAME is not checked. Function will still give a warning
  52. even if the caller would quietly skip non-existing file in unsafe
  53. directory. */
  54. extern bool file_is_auto_load_safe (const char *filename);
  55. /* Return true if auto-loading gdb scripts is enabled. */
  56. extern bool auto_load_gdb_scripts_enabled
  57. (const struct extension_language_defn *extlang);
  58. #endif /* AUTO_LOAD_H */