GDB (xrefs)
|
#include "defs.h"
#include "auto-load.h"
#include "progspace.h"
#include "python/python.h"
#include "gdb_regex.h"
#include "ui-out.h"
#include "filenames.h"
#include "command.h"
#include "observer.h"
#include "objfiles.h"
#include "exceptions.h"
#include "cli/cli-script.h"
#include "gdbcmd.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"
Go to the source code of this file.
#define GDB_AUTO_FILE_NAME "-gdb.gdb" |
Definition at line 45 of file auto-load.c.
typedef struct loaded_script* loaded_script_ptr |
Definition at line 873 of file auto-load.c.
void _initialize_auto_load | ( | void | ) |
static void add_auto_load_safe_path | ( | char * | args, |
int | from_tty | ||
) | [static] |
Definition at line 285 of file auto-load.c.
References _, auto_load_safe_path, auto_load_safe_path_vec_update(), error(), xfree(), and xstrprintf().
static void auto_load_gdb_datadir_changed | ( | void | ) | [static] |
Definition at line 238 of file auto-load.c.
References auto_load_safe_path_vec_update().
struct cmd_list_element** auto_load_info_cmdlist_get | ( | void | ) | [read] |
Definition at line 1172 of file auto-load.c.
References _, add_prefix_cmd(), class_info, info_auto_load_cmd(), and infolist.
Referenced by _initialize_thread_db(), and info_auto_load_cmd().
void auto_load_info_scripts | ( | char * | pattern, |
int | from_tty, | ||
const struct script_language * | language | ||
) |
Definition at line 945 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_scripts, make_cleanup(), make_cleanup_ui_out_table_begin_end(), print_script(), qsort, re_comp(), sort_scripts_by_name(), ui_left, ui_out_message(), ui_out_table_body(), ui_out_table_header(), ui_out_text(), VEC, VEC_address, VEC_alloc, VEC_cleanup, VEC_iterate, and VEC_length.
Referenced by info_auto_load_gdb_scripts().
static void auto_load_new_objfile | ( | struct objfile * | objfile | ) | [static] |
Definition at line 859 of file auto-load.c.
References clear_section_scripts(), and load_auto_scripts_for_objfile().
void auto_load_objfile_script | ( | struct objfile * | objfile, |
const struct script_language * | language | ||
) |
Definition at line 809 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 load_auto_scripts_for_objfile().
static int auto_load_objfile_script_1 | ( | struct objfile * | objfile, |
const char * | realname, | ||
const struct script_language * | language | ||
) | [static] |
Definition at line 727 of file auto-load.c.
References _, auto_load_dir, debug_auto_load, do_cleanups(), fprintf_unfiltered(), gdb_fopen_cloexec(), gdb_stdlog, len, make_cleanup(), make_cleanup_fclose(), make_cleanup_free_char_ptr_vec(), memcpy(), script_language::source_script_for_objfile, script_language::suffix, VEC, VEC_iterate, xfree(), and xmalloc().
Referenced by auto_load_objfile_script().
static void auto_load_pspace_data_cleanup | ( | struct program_space * | pspace, |
void * | arg | ||
) | [static] |
Definition at line 573 of file auto-load.c.
References auto_load_pspace_data, auto_load_pspace_info::loaded_scripts, and xfree().
static void auto_load_safe_path_vec_update | ( | void | ) | [static] |
Definition at line 180 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 add_auto_load_safe_path(), auto_load_gdb_datadir_changed(), file_is_auto_load_safe(), and set_auto_load_safe_path().
struct cmd_list_element** auto_load_set_cmdlist_get | ( | void | ) | [read] |
Definition at line 1094 of file auto-load.c.
References _, add_prefix_cmd(), class_maintenance, set_auto_load_cmd(), and setlist.
Referenced by _initialize_thread_db(), and set_auto_load_cmd().
struct cmd_list_element** auto_load_show_cmdlist_get | ( | void | ) | [read] |
Definition at line 1121 of file auto-load.c.
References _, add_prefix_cmd(), class_maintenance, show_auto_load_cmd(), and showlist.
Referenced by _initialize_thread_db(), and show_auto_load_cmd().
static void clear_section_scripts | ( | void | ) | [static] |
Definition at line 708 of file auto-load.c.
References auto_load_pspace_data, current_program_space, auto_load_pspace_info::loaded_scripts, and auto_load_pspace_info::script_not_found_warning_printed.
Referenced by auto_load_new_objfile().
static int collect_matching_scripts | ( | void ** | slot, |
void * | info | ||
) | [static] |
Definition at line 887 of file auto-load.c.
References loaded_script::language, loaded_script::name, and VEC_safe_push.
Referenced by auto_load_info_scripts().
static int eq_loaded_script_entry | ( | const void * | a, |
const void * | b | ||
) | [static] |
Definition at line 617 of file auto-load.c.
References loaded_script::language, and loaded_script::name.
Referenced by init_loaded_scripts_info().
int file_is_auto_load_safe | ( | const char * | filename, |
const char * | debug_fmt, | ||
... | |||
) |
Definition at line 441 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 captured_main(), source_gdb_script_for_objfile(), try_thread_db_load_from_dir(), and try_thread_db_load_from_pdir_1().
static int filename_is_in_auto_load_safe_path_vec | ( | const char * | filename, |
char ** | filename_realp | ||
) | [static] |
Definition at line 390 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 ATTRIBUTE_PURE int filename_is_in_pattern | ( | const char * | filename, |
const char * | pattern | ||
) | [static] |
Definition at line 371 of file auto-load.c.
References filename_is_in_pattern_1().
Referenced by filename_is_in_auto_load_safe_path_vec().
static int filename_is_in_pattern_1 | ( | char * | filename, |
char * | pattern | ||
) | [static] |
Definition at line 306 of file auto-load.c.
References _, debug_auto_load, fprintf_unfiltered(), gdb_filename_fnmatch(), and gdb_stdlog.
Referenced by filename_is_in_pattern().
static struct auto_load_pspace_info* get_auto_load_pspace_data | ( | struct program_space * | pspace | ) | [static, read] |
Definition at line 590 of file auto-load.c.
References auto_load_pspace_data, and XZALLOC.
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 | ) | [read] |
Definition at line 647 of file auto-load.c.
References get_auto_load_pspace_data(), init_loaded_scripts_info(), and auto_load_pspace_info::loaded_scripts.
Referenced by source_gdb_script_for_objfile().
static hashval_t hash_loaded_script_entry | ( | const void * | data | ) | [static] |
Definition at line 607 of file auto-load.c.
References loaded_script::language, and loaded_script::name.
Referenced by init_loaded_scripts_info().
static void info_auto_load_cmd | ( | char * | args, |
int | from_tty | ||
) | [static] |
Definition at line 1141 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 void info_auto_load_gdb_scripts | ( | char * | pattern, |
int | from_tty | ||
) | [static] |
Definition at line 1027 of file auto-load.c.
References auto_load_info_scripts(), and script_language_gdb.
static void info_auto_load_local_gdbinit | ( | char * | args, |
int | from_tty | ||
) | [static] |
Definition at line 1035 of file auto-load.c.
References _, auto_load_local_gdbinit_loaded, auto_load_local_gdbinit_pathname, and printf_filtered().
static void init_loaded_scripts_info | ( | struct auto_load_pspace_info * | pspace_info | ) | [static] |
Definition at line 629 of file auto-load.c.
References eq_loaded_script_entry(), hash_loaded_script_entry(), auto_load_pspace_info::loaded_scripts, auto_load_pspace_info::script_not_found_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 841 of file auto-load.c.
References auto_load_gdb_scripts, auto_load_objfile_script(), objfile::flags, gdbpy_load_auto_scripts_for_objfile(), global_auto_load, OBJF_NOT_FILENAME, and script_language_gdb.
Referenced by auto_load_new_objfile(), and captured_main().
int maybe_add_script | ( | struct auto_load_pspace_info * | pspace_info, |
int | loaded, | ||
const char * | name, | ||
const char * | full_path, | ||
const struct script_language * | language | ||
) |
Definition at line 664 of file auto-load.c.
References loaded_script::language, auto_load_pspace_info::loaded_scripts, name, loaded_script::name, p, and xmalloc().
Referenced by source_gdb_script_for_objfile().
static void print_script | ( | struct loaded_script * | script | ) | [static] |
Definition at line 901 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 auto_load_info_scripts().
int script_not_found_warning_print | ( | struct auto_load_pspace_info * | pspace_info | ) |
Definition at line 1052 of file auto-load.c.
References auto_load_pspace_info::script_not_found_warning_printed.
static void set_auto_load_cmd | ( | char * | args, |
int | from_tty | ||
) | [static] |
Definition at line 1064 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 void set_auto_load_dir | ( | char * | args, |
int | from_tty, | ||
struct cmd_list_element * | c | ||
) | [static] |
Definition at line 122 of file auto-load.c.
References AUTO_LOAD_DIR, auto_load_dir, and xfree().
static void set_auto_load_safe_path | ( | char * | args, |
int | from_tty, | ||
struct cmd_list_element * | c | ||
) | [static] |
Definition at line 246 of file auto-load.c.
References AUTO_LOAD_SAFE_PATH, auto_load_safe_path, auto_load_safe_path_vec_update(), and xfree().
static void show_auto_load_cmd | ( | char * | args, |
int | from_tty | ||
) | [static] |
Definition at line 1113 of file auto-load.c.
References auto_load_show_cmdlist_get(), and cmd_show_list().
Referenced by auto_load_show_cmdlist_get().
static void show_auto_load_dir | ( | struct ui_file * | file, |
int | from_tty, | ||
struct cmd_list_element * | c, | ||
const char * | value | ||
) | [static] |
Definition at line 135 of file auto-load.c.
References _, and fprintf_filtered().
static void show_auto_load_gdb_scripts | ( | struct ui_file * | file, |
int | from_tty, | ||
struct cmd_list_element * | c, | ||
const char * | value | ||
) | [static] |
Definition at line 74 of file auto-load.c.
References _, and fprintf_filtered().
static void show_auto_load_local_gdbinit | ( | struct ui_file * | file, |
int | from_tty, | ||
struct cmd_list_element * | c, | ||
const char * | value | ||
) | [static] |
Definition at line 106 of file auto-load.c.
References _, and fprintf_filtered().
static void show_auto_load_safe_path | ( | struct ui_file * | file, |
int | from_tty, | ||
struct cmd_list_element * | c, | ||
const char * | value | ||
) | [static] |
Definition at line 261 of file auto-load.c.
References _, and fprintf_filtered().
static void show_debug_auto_load | ( | struct ui_file * | file, |
int | from_tty, | ||
struct cmd_list_element * | c, | ||
const char * | value | ||
) | [static] |
Definition at line 56 of file auto-load.c.
References _, and fprintf_filtered().
static int sort_scripts_by_name | ( | const void * | ap, |
const void * | bp | ||
) | [static] |
Definition at line 927 of file auto-load.c.
References loaded_script::name.
Referenced by auto_load_info_scripts().
static void source_gdb_script_for_objfile | ( | struct objfile * | objfile, |
FILE * | file, | ||
const char * | filename | ||
) | [static] |
Definition at line 509 of file auto-load.c.
References _, current_program_space, exception_print(), file_is_auto_load_safe(), gdb_stderr, get_auto_load_pspace_data_for_loading(), maybe_add_script(), objfile_name(), RETURN_MASK_ALL, script_from_file(), script_language_gdb, and TRY_CATCH.
Definition at line 151 of file auto-load.c.
References _, debug_auto_load, debug_file_directory, fprintf_unfiltered(), gdb_datadir, gdb_stdlog, substitute_path_component(), VEC, and xfree().
char* auto_load_dir [static] |
Definition at line 117 of file auto-load.c.
Referenced by auto_load_objfile_script_1(), and set_auto_load_dir().
int auto_load_gdb_scripts = 1 [static] |
Definition at line 69 of file auto-load.c.
Referenced by load_auto_scripts_for_objfile().
char auto_load_info_scripts_pattern_nl[] = "" |
Definition at line 938 of file auto-load.c.
Referenced by auto_load_info_scripts(), info_auto_load_cmd(), and info_auto_load_libthread_db().
Definition at line 95 of file auto-load.c.
Referenced by captured_main().
Definition at line 101 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 98 of file auto-load.c.
Referenced by captured_main(), and info_auto_load_local_gdbinit().
struct program_space_data* auto_load_pspace_data [static] |
Definition at line 570 of file auto-load.c.
Referenced by auto_load_pspace_data_cleanup(), clear_section_scripts(), and get_auto_load_pspace_data().
char* auto_load_safe_path [static] |
Definition at line 146 of file auto-load.c.
Referenced by add_auto_load_safe_path(), auto_load_safe_path_vec_update(), file_is_auto_load_safe(), and set_auto_load_safe_path().
int debug_auto_load = 0 [static] |
Definition at line 51 of file auto-load.c.
Referenced by 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 92 of file auto-load.c.
Referenced by captured_main(), and load_auto_scripts_for_objfile().
struct script_language script_language_gdb = { GDB_AUTO_FILE_NAME, source_gdb_script_for_objfile } [static] |
Definition at line 506 of file auto-load.c.
Referenced by info_auto_load_gdb_scripts(), load_auto_scripts_for_objfile(), and source_gdb_script_for_objfile().