GDB (xrefs)
|
#include "defs.h"
#include <ctype.h>
#include "auto-load.h"
#include "progspace.h"
#include "gdb_regex.h"
#include "ui-out.h"
#include "filenames.h"
#include "command.h"
#include "observer.h"
#include "objfiles.h"
#include "cli/cli-script.h"
#include "gdbcmd.h"
#include "cli/cli-cmds.h"
#include "cli/cli-decode.h"
#include "cli/cli-setshow.h"
#include "gdb_vecs.h"
#include "readline/tilde.h"
#include "completer.h"
#include "fnmatch.h"
#include "top.h"
#include "filestuff.h"
#include "extension.h"
#include "gdb/section-scripts.h"
Go to the source code of this file.
Classes | |
struct | auto_load_pspace_info |
struct | loaded_script |
struct | collect_matching_scripts_data |
Macros | |
#define | AUTO_SECTION_NAME ".debug_gdb_scripts" |
Typedefs | |
typedef struct loaded_script * | loaded_script_ptr |
Variables | |
static int | debug_auto_load = 0 |
static int | auto_load_gdb_scripts = 1 |
int | global_auto_load = 1 |
int | auto_load_local_gdbinit = 1 |
char * | auto_load_local_gdbinit_pathname = NULL |
int | auto_load_local_gdbinit_loaded = 0 |
static char * | auto_load_dir |
static char * | auto_load_safe_path |
static const struct program_space_data * | auto_load_pspace_data |
char | auto_load_info_scripts_pattern_nl [] = "" |
#define AUTO_SECTION_NAME ".debug_gdb_scripts" |
Definition at line 50 of file auto-load.c.
Referenced by load_auto_scripts_for_objfile().
typedef struct loaded_script* loaded_script_ptr |
Definition at line 1234 of file auto-load.c.
void _initialize_auto_load | ( | void | ) |
Definition at line 1603 of file auto-load.c.
References _, add_auto_load_dir(), add_auto_load_safe_path(), add_cmd(), add_setshow_boolean_cmd(), add_setshow_optional_filename_cmd(), AUTO_LOAD_DIR, auto_load_dir, auto_load_gdb_datadir_changed(), auto_load_gdb_scripts, auto_load_info_cmdlist_get(), auto_load_local_gdbinit, auto_load_new_objfile(), auto_load_pspace_data, auto_load_pspace_data_cleanup(), AUTO_LOAD_SAFE_PATH, auto_load_safe_path, auto_load_safe_path_vec_update(), auto_load_set_cmdlist_get(), auto_load_show_cmdlist_get(), class_info, class_maintenance, class_support, cmdlist, debug_auto_load, ext_lang_auto_load_suffix(), EXT_LANG_GDB, EXT_LANG_GUILE, EXT_LANG_PYTHON, get_ext_lang_defn(), info_auto_load_gdb_scripts(), info_auto_load_local_gdbinit(), observer_attach_gdb_datadir_changed(), observer_attach_new_objfile(), set_auto_load_dir(), set_auto_load_safe_path(), set_cmd_completer(), setdebuglist, show_auto_load_dir(), show_auto_load_gdb_scripts(), show_auto_load_local_gdbinit(), show_auto_load_safe_path(), show_debug_auto_load(), showdebuglist, xfree(), and xstrprintf().
|
static |
Definition at line 326 of file auto-load.c.
References _, auto_load_dir, DIRNAME_SEPARATOR, error(), xfree(), and xstrprintf().
Referenced by _initialize_auto_load().
|
static |
Definition at line 305 of file auto-load.c.
References _, auto_load_safe_path, auto_load_safe_path_vec_update(), DIRNAME_SEPARATOR, error(), xfree(), and xstrprintf().
Referenced by _initialize_auto_load().
|
static |
Definition at line 258 of file auto-load.c.
References auto_load_safe_path_vec_update().
Referenced by _initialize_auto_load().
int auto_load_gdb_scripts_enabled | ( | const struct extension_language_defn * | extlang | ) |
Definition at line 97 of file auto-load.c.
References auto_load_gdb_scripts.
struct cmd_list_element** auto_load_info_cmdlist_get | ( | void | ) |
Definition at line 1585 of file auto-load.c.
References _, add_prefix_cmd(), class_info, info_auto_load_cmd(), and infolist.
Referenced by _initialize_auto_load(), _initialize_thread_db(), gdbpy_initialize_auto_load(), gdbscm_initialize_auto_load(), and info_auto_load_cmd().
void auto_load_info_scripts | ( | char * | pattern, |
int | from_tty, | ||
const struct extension_language_defn * | language | ||
) |
Definition at line 1323 of file auto-load.c.
References _, auto_load_info_scripts_pattern_nl, collect_matching_scripts(), current_program_space, current_uiout, do_cleanups(), dont_repeat(), error(), get_auto_load_pspace_data(), auto_load_pspace_info::loaded_script_files, auto_load_pspace_info::loaded_script_texts, make_cleanup(), make_cleanup_ui_out_table_begin_end(), print_scripts(), re_comp(), ui_left, ui_out_message(), ui_out_table_body(), ui_out_table_header(), ui_out_text(), VEC(), VEC_alloc, VEC_cleanup, and VEC_length.
Referenced by info_auto_load_gdb_scripts(), info_auto_load_guile_scripts(), and info_auto_load_python_scripts().
|
static |
Definition at line 1220 of file auto-load.c.
References clear_section_scripts(), and load_auto_scripts_for_objfile().
Referenced by _initialize_auto_load().
void auto_load_objfile_script | ( | struct objfile * | objfile, |
const struct extension_language_defn * | language | ||
) |
Definition at line 890 of file auto-load.c.
References _, auto_load_objfile_script_1(), debug_auto_load, do_cleanups(), fprintf_unfiltered(), gdb_realpath(), gdb_stdlog, len, make_cleanup(), objfile_name(), and xfree().
Referenced by auto_load_ext_lang_scripts_for_objfile().
|
static |
Definition at line 780 of file auto-load.c.
References _, auto_load_dir, current_program_space, debug_auto_load, do_cleanups(), ext_lang_auto_load_suffix(), ext_lang_name(), ext_lang_objfile_script_sourcer(), file_is_auto_load_safe(), fprintf_unfiltered(), gdb_assert, gdb_fopen_cloexec(), gdb_stdlog, get_auto_load_pspace_data_for_loading(), len, make_cleanup(), make_cleanup_fclose(), make_cleanup_free_char_ptr_vec(), maybe_add_script_file(), objfile_name(), VEC(), VEC_iterate, xfree(), and xmalloc().
Referenced by auto_load_objfile_script().
|
static |
Definition at line 581 of file auto-load.c.
References auto_load_pspace_info::loaded_script_files, auto_load_pspace_info::loaded_script_texts, and xfree().
Referenced by _initialize_auto_load().
|
static |
Definition at line 200 of file auto-load.c.
References _, auto_load_safe_path, debug_auto_load, fprintf_unfiltered(), free_char_ptr_vec(), gdb_realpath(), gdb_stdlog, len, VEC_index, VEC_length, VEC_replace, VEC_safe_push, and xfree().
Referenced by _initialize_auto_load(), add_auto_load_safe_path(), auto_load_gdb_datadir_changed(), file_is_auto_load_safe(), and set_auto_load_safe_path().
|
static |
Definition at line 1166 of file auto-load.c.
References _, do_cleanups(), make_cleanup(), objfile::obfd, source_section_scripts(), warning(), and xfree().
Referenced by load_auto_scripts_for_objfile().
struct cmd_list_element** auto_load_set_cmdlist_get | ( | void | ) |
Definition at line 1507 of file auto-load.c.
References _, add_prefix_cmd(), class_maintenance, set_auto_load_cmd(), and setlist.
Referenced by _initialize_auto_load(), _initialize_thread_db(), gdbpy_initialize_auto_load(), gdbscm_initialize_auto_load(), and set_auto_load_cmd().
struct cmd_list_element** auto_load_show_cmdlist_get | ( | void | ) |
Definition at line 1534 of file auto-load.c.
References _, add_prefix_cmd(), class_maintenance, show_auto_load_cmd(), and showlist.
Referenced by _initialize_auto_load(), _initialize_thread_db(), gdbpy_initialize_auto_load(), gdbscm_initialize_auto_load(), and show_auto_load_cmd().
|
static |
Definition at line 758 of file auto-load.c.
References auto_load_pspace_data, current_program_space, auto_load_pspace_info::loaded_script_files, auto_load_pspace_info::loaded_script_texts, auto_load_pspace_info::script_not_found_warning_printed, and auto_load_pspace_info::unsupported_script_warning_printed.
Referenced by auto_load_new_objfile().
|
static |
Definition at line 1248 of file auto-load.c.
References loaded_script::language, loaded_script::name, and VEC_safe_push.
Referenced by auto_load_info_scripts().
DEF_VEC_P | ( | loaded_script_ptr | ) |
Definition at line 623 of file auto-load.c.
References loaded_script::language, and loaded_script::name.
Referenced by init_loaded_scripts_info().
|
static |
Definition at line 1003 of file auto-load.c.
References _, do_cleanups(), ext_lang_auto_load_enabled(), ext_lang_name(), ext_lang_objfile_script_executor(), file_is_auto_load_safe(), make_cleanup(), maybe_add_script_text(), maybe_print_unsupported_script_warning(), name, null_cleanup(), objfile_name(), warning(), and xfree().
Referenced by source_section_scripts().
Definition at line 477 of file auto-load.c.
References _, auto_load_safe_path, auto_load_safe_path_vec_update(), debug_auto_load, do_cleanups(), filename_is_in_auto_load_safe_path_vec(), free_current_contents(), gdb_stdlog, gdbinit, make_cleanup(), printf_filtered(), vfprintf_unfiltered(), warning(), xfree(), and xstrprintf().
Referenced by auto_load_objfile_script_1(), captured_main(), execute_script_contents(), source_script_file(), and try_thread_db_load().
|
static |
Definition at line 426 of file auto-load.c.
References _, debug_auto_load, filename_is_in_pattern(), fprintf_unfiltered(), gdb_realpath(), gdb_stdlog, and VEC_iterate.
Referenced by file_is_auto_load_safe().
|
static |
Definition at line 407 of file auto-load.c.
References filename_is_in_pattern_1().
Referenced by filename_is_in_auto_load_safe_path_vec().
|
static |
Definition at line 342 of file auto-load.c.
References _, debug_auto_load, fprintf_unfiltered(), gdb_filename_fnmatch(), and gdb_stdlog.
Referenced by filename_is_in_pattern().
|
static |
Definition at line 596 of file auto-load.c.
References auto_load_pspace_data.
Referenced by auto_load_info_scripts(), and get_auto_load_pspace_data_for_loading().
struct auto_load_pspace_info* get_auto_load_pspace_data_for_loading | ( | struct program_space * | pspace | ) |
Definition at line 658 of file auto-load.c.
References get_auto_load_pspace_data(), init_loaded_scripts_info(), and auto_load_pspace_info::loaded_script_files.
Referenced by auto_load_objfile_script_1(), and source_section_scripts().
|
static |
Definition at line 613 of file auto-load.c.
References loaded_script::language, and loaded_script::name.
Referenced by init_loaded_scripts_info().
|
static |
Definition at line 1554 of file auto-load.c.
References auto_load_info_cmdlist_get(), auto_load_info_scripts_pattern_nl, cmd_func(), current_uiout, do_cleanups(), gdb_assert, make_cleanup_ui_out_tuple_begin_end(), cmd_list_element::name, cmd_list_element::next, not_set_cmd, cmd_list_element::prefixlist, cmd_list_element::type, ui_out_field_string(), and ui_out_text().
Referenced by auto_load_info_cmdlist_get().
|
static |
Definition at line 1410 of file auto-load.c.
References auto_load_info_scripts(), and extension_language_gdb.
Referenced by _initialize_auto_load().
|
static |
Definition at line 1418 of file auto-load.c.
References _, auto_load_local_gdbinit_loaded, auto_load_local_gdbinit_pathname, and printf_filtered().
Referenced by _initialize_auto_load().
|
static |
Definition at line 635 of file auto-load.c.
References eq_loaded_script_entry(), hash_loaded_script_entry(), auto_load_pspace_info::loaded_script_files, auto_load_pspace_info::loaded_script_texts, auto_load_pspace_info::script_not_found_warning_printed, auto_load_pspace_info::unsupported_script_warning_printed, and xfree().
Referenced by get_auto_load_pspace_data_for_loading().
void load_auto_scripts_for_objfile | ( | struct objfile * | objfile | ) |
Definition at line 1194 of file auto-load.c.
References auto_load_ext_lang_scripts_for_objfile(), auto_load_section_scripts(), AUTO_SECTION_NAME, objfile::flags, global_auto_load, is_target_filename(), OBJF_NOT_FILENAME, and objfile::original_name.
Referenced by auto_load_new_objfile(), and captured_main().
|
static |
Definition at line 676 of file auto-load.c.
References loaded_script::language, auto_load_pspace_info::loaded_script_files, name, loaded_script::name, and xmalloc().
Referenced by auto_load_objfile_script_1(), and source_script_file().
|
static |
Definition at line 723 of file auto-load.c.
References loaded_script::language, loaded_script::loaded, auto_load_pspace_info::loaded_script_texts, name, loaded_script::name, and xmalloc().
Referenced by execute_script_contents().
|
static |
Definition at line 1458 of file auto-load.c.
References _, ext_lang_name(), objfile_name(), auto_load_pspace_info::script_not_found_warning_printed, and warning().
Referenced by source_script_file().
|
static |
Definition at line 1436 of file auto-load.c.
References _, ext_lang_name(), objfile_name(), auto_load_pspace_info::unsupported_script_warning_printed, and warning().
Referenced by execute_script_contents(), and source_script_file().
|
static |
Definition at line 1262 of file auto-load.c.
References current_uiout, do_cleanups(), loaded_script::full_path, loaded_script::loaded, make_cleanup_ui_out_tuple_begin_end(), loaded_script::name, ui_out_field_string(), and ui_out_text().
Referenced by print_scripts().
|
static |
Definition at line 1305 of file auto-load.c.
References current_uiout, print_script(), qsort, sort_scripts_by_name(), VEC_address, VEC_iterate, and VEC_length.
Referenced by auto_load_info_scripts().
|
static |
Definition at line 1477 of file auto-load.c.
References _, auto_load_set_cmdlist_get(), do_set_command(), error(), gdb_assert, cmd_list_element::next, set_cmd, cmd_list_element::type, var_boolean, and cmd_list_element::var_type.
Referenced by auto_load_set_cmdlist_get().
|
static |
Definition at line 142 of file auto-load.c.
References AUTO_LOAD_DIR, auto_load_dir, and xfree().
Referenced by _initialize_auto_load().
|
static |
Definition at line 266 of file auto-load.c.
References AUTO_LOAD_SAFE_PATH, auto_load_safe_path, auto_load_safe_path_vec_update(), and xfree().
Referenced by _initialize_auto_load().
|
static |
Definition at line 1526 of file auto-load.c.
References auto_load_show_cmdlist_get(), and cmd_show_list().
Referenced by auto_load_show_cmdlist_get().
|
static |
Definition at line 155 of file auto-load.c.
References _, and fprintf_filtered().
Referenced by _initialize_auto_load().
|
static |
Definition at line 86 of file auto-load.c.
References _, and fprintf_filtered().
Referenced by _initialize_auto_load().
|
static |
Definition at line 126 of file auto-load.c.
References _, and fprintf_filtered().
Referenced by _initialize_auto_load().
|
static |
Definition at line 281 of file auto-load.c.
References _, DIRNAME_SEPARATOR, and fprintf_filtered().
Referenced by _initialize_auto_load().
|
static |
Definition at line 68 of file auto-load.c.
References _, and fprintf_filtered().
Referenced by _initialize_auto_load().
Definition at line 1288 of file auto-load.c.
References loaded_script::name.
Referenced by print_scripts().
|
static |
Definition at line 924 of file auto-load.c.
References _, do_cleanups(), ext_lang_auto_load_enabled(), ext_lang_name(), ext_lang_objfile_script_sourcer(), file_is_auto_load_safe(), find_and_open_script(), make_cleanup(), make_cleanup_fclose(), maybe_add_script_file(), maybe_print_script_not_found_warning(), maybe_print_unsupported_script_warning(), null_cleanup(), objfile_name(), and xfree().
Referenced by source_section_scripts().
|
static |
Definition at line 1098 of file auto-load.c.
References _, code, current_program_space, execute_script_contents(), EXT_LANG_GUILE, EXT_LANG_PYTHON, get_auto_load_pspace_data_for_loading(), get_ext_lang_defn(), offset, source_script_file(), and warning().
Referenced by auto_load_section_scripts().
|
static |
Definition at line 171 of file auto-load.c.
References _, debug_auto_load, debug_file_directory, fprintf_unfiltered(), gdb_datadir, gdb_stdlog, substitute_path_component(), and xfree().
Referenced by auto_load_info_scripts(), and auto_load_objfile_script_1().
|
static |
Definition at line 137 of file auto-load.c.
Referenced by _initialize_auto_load(), add_auto_load_dir(), auto_load_objfile_script_1(), and set_auto_load_dir().
|
static |
Definition at line 81 of file auto-load.c.
Referenced by _initialize_auto_load(), and auto_load_gdb_scripts_enabled().
char auto_load_info_scripts_pattern_nl[] = "" |
Definition at line 1299 of file auto-load.c.
Referenced by auto_load_info_scripts(), info_auto_load_cmd(), and info_auto_load_libthread_db().
int auto_load_local_gdbinit = 1 |
Definition at line 115 of file auto-load.c.
Referenced by _initialize_auto_load(), and captured_main().
int auto_load_local_gdbinit_loaded = 0 |
Definition at line 121 of file auto-load.c.
Referenced by captured_main(), and info_auto_load_local_gdbinit().
char* auto_load_local_gdbinit_pathname = NULL |
Definition at line 118 of file auto-load.c.
Referenced by captured_main(), and info_auto_load_local_gdbinit().
|
static |
Definition at line 578 of file auto-load.c.
Referenced by _initialize_auto_load(), clear_section_scripts(), and get_auto_load_pspace_data().
|
static |
Definition at line 166 of file auto-load.c.
Referenced by _initialize_auto_load(), add_auto_load_safe_path(), auto_load_safe_path_vec_update(), file_is_auto_load_safe(), and set_auto_load_safe_path().
|
static |
Definition at line 63 of file auto-load.c.
Referenced by _initialize_auto_load(), auto_load_objfile_script(), auto_load_objfile_script_1(), auto_load_safe_path_vec_update(), file_is_auto_load_safe(), filename_is_in_auto_load_safe_path_vec(), filename_is_in_pattern_1(), and VEC().
int global_auto_load = 1 |
Definition at line 112 of file auto-load.c.
Referenced by captured_main(), and load_auto_scripts_for_objfile().