GDB (xrefs)
|
#include "defs.h"
#include <sys/types.h>
#include <fcntl.h>
#include "symtab.h"
#include "bfd.h"
#include "symfile.h"
#include "objfiles.h"
#include "gdbcore.h"
#include "command.h"
#include "target.h"
#include "frame.h"
#include "gdb_regex.h"
#include "inferior.h"
#include "environ.h"
#include "language.h"
#include "gdbcmd.h"
#include "completer.h"
#include "filenames.h"
#include "exec.h"
#include "solist.h"
#include "observer.h"
#include "readline/readline.h"
#include "remote.h"
#include "solib.h"
#include "interps.h"
#include "filesystem.h"
#include "gdb_bfd.h"
#include "filestuff.h"
Go to the source code of this file.
Macros | |
#define | so_list_head current_program_space->so_list |
#define | DOS_BASED_FILE_SYSTEM 0 |
Functions | |
static void * | solib_init (struct obstack *obstack) |
static const struct target_so_ops * | solib_ops (struct gdbarch *gdbarch) |
void | set_solib_ops (struct gdbarch *gdbarch, const struct target_so_ops *new_ops) |
static void | show_solib_search_path (struct ui_file *file, int from_tty, struct cmd_list_element *c, const char *value) |
static char * | solib_find_1 (char *in_pathname, int *fd, int is_solib) |
char * | exec_file_find (char *in_pathname, int *fd) |
char * | solib_find (char *in_pathname, int *fd) |
bfd * | solib_bfd_fopen (char *pathname, int fd) |
bfd * | solib_bfd_open (char *pathname) |
static int | solib_map_sections (struct so_list *so) |
static void | clear_so (struct so_list *so) |
void | free_so (struct so_list *so) |
struct so_list * | master_so_list (void) |
int | solib_read_symbols (struct so_list *so, int flags) |
static int | solib_used (const struct so_list *const known) |
static void | update_solib_list (int from_tty, struct target_ops *target) |
int | libpthread_name_p (const char *name) |
static int | libpthread_solib_p (struct so_list *so) |
void | solib_add (const char *pattern, int from_tty, struct target_ops *target, int readsyms) |
static void | info_sharedlibrary_command (char *pattern, int from_tty) |
int | solib_contains_address_p (const struct so_list *const solib, CORE_ADDR address) |
char * | solib_name_from_address (struct program_space *pspace, CORE_ADDR address) |
int | solib_keep_data_in_core (CORE_ADDR vaddr, unsigned long size) |
void | clear_solib (void) |
void | solib_create_inferior_hook (int from_tty) |
int | in_solib_dynsym_resolve_code (CORE_ADDR pc) |
static void | sharedlibrary_command (char *args, int from_tty) |
void | no_shared_libraries (char *ignored, int from_tty) |
void | update_solib_breakpoints (void) |
void | handle_solib_event (void) |
static void | reload_shared_libraries_1 (int from_tty) |
static void | reload_shared_libraries (char *ignored, int from_tty, struct cmd_list_element *e) |
static void | gdb_sysroot_changed (char *ignored, int from_tty, struct cmd_list_element *e) |
static void | show_auto_solib_add (struct ui_file *file, int from_tty, struct cmd_list_element *c, const char *value) |
struct symbol * | solib_global_lookup (struct objfile *objfile, const char *name, const domain_enum domain) |
CORE_ADDR | gdb_bfd_lookup_symbol_from_symtab (bfd *abfd, int(*match_sym)(asymbol *, void *), void *data) |
static CORE_ADDR | bfd_lookup_symbol_from_dyn_symtab (bfd *abfd, int(*match_sym)(asymbol *, void *), void *data) |
CORE_ADDR | gdb_bfd_lookup_symbol (bfd *abfd, int(*match_sym)(asymbol *, void *), void *data) |
static void | remove_user_added_objfile (struct objfile *objfile) |
void | _initialize_solib (void) |
Variables | |
static struct gdbarch_data * | solib_data |
struct target_so_ops * | current_target_so_ops |
static char * | solib_search_path = NULL |
initialize_file_ftype | _initialize_solib |
#define DOS_BASED_FILE_SYSTEM 0 |
Definition at line 112 of file solib.c.
Referenced by solib_find_1().
#define so_list_head current_program_space->so_list |
Definition at line 91 of file solib.c.
Referenced by clear_solib(), info_sharedlibrary_command(), master_so_list(), reload_shared_libraries_1(), remove_user_added_objfile(), solib_add(), solib_used(), and update_solib_list().
void _initialize_solib | ( | void | ) |
Definition at line 1663 of file solib.c.
References _, add_alias_cmd(), add_com(), add_info(), add_info_alias(), add_setshow_boolean_cmd(), add_setshow_optional_filename_cmd(), auto_solib_add, class_files, class_support, gdb_sysroot, gdb_sysroot_changed(), gdbarch_data_register_pre_init(), info_sharedlibrary_command(), no_shared_libraries(), observer_attach_free_objfile(), reload_shared_libraries(), remove_user_added_objfile(), setlist, sharedlibrary_command(), show_auto_solib_add(), show_solib_search_path(), showlist, solib_init(), and solib_search_path.
|
static |
Definition at line 1591 of file solib.c.
References do_cleanups(), make_cleanup(), xfree(), and xmalloc().
Referenced by gdb_bfd_lookup_symbol().
|
static |
Definition at line 606 of file solib.c.
References so_list::abfd, so_list::addr_high, so_list::addr_low, target_so_ops::clear_so, gdb_bfd_unref(), so_list::objfile, so_list::sections, so_list::sections_end, so_list::so_name, so_list::so_original_name, solib_ops(), so_list::symbols_loaded, target_gdbarch(), and xfree().
Referenced by free_so(), and reload_shared_libraries_1().
void clear_solib | ( | void | ) |
Definition at line 1222 of file solib.c.
References target_so_ops::clear_solib, disable_breakpoints_in_shlibs(), exec_bfd, free_so(), so_list::next, observer_notify_solib_unloaded(), remove_target_sections(), so_list_head, solib_ops(), and target_gdbarch().
Referenced by core_close(), and no_shared_libraries().
char* exec_file_find | ( | char * | in_pathname, |
int * | fd | ||
) |
Definition at line 387 of file solib.c.
References effective_target_file_system_kind(), file_system_kind_dos_based, and solib_find_1().
Referenced by exec_file_locate_attach(), and follow_exec().
void free_so | ( | struct so_list * | so | ) |
Definition at line 646 of file solib.c.
References clear_so(), target_so_ops::free_so, solib_ops(), target_gdbarch(), and xfree().
Referenced by clear_solib(), do_free_so(), svr4_current_sos(), svr4_free_library_list(), and update_solib_list().
Definition at line 1629 of file solib.c.
References bfd_lookup_symbol_from_dyn_symtab(), and gdb_bfd_lookup_symbol_from_symtab().
Referenced by enable_break(), and enable_break2().
CORE_ADDR gdb_bfd_lookup_symbol_from_symtab | ( | bfd * | abfd, |
int(*)(asymbol *, void *) | match_sym, | ||
void * | data | ||
) |
Definition at line 1532 of file solib.c.
References do_cleanups(), gdbarch_elf_make_msymbol_special(), gdbarch_elf_make_msymbol_special_p(), make_cleanup(), MSYMBOL_VALUE_RAW_ADDRESS, SET_MSYMBOL_VALUE_ADDRESS, target_gdbarch(), xfree(), and xmalloc().
Referenced by gdb_bfd_lookup_symbol().
|
static |
Definition at line 1476 of file solib.c.
References _, gdb_assert, gdb_sysroot, reload_shared_libraries(), startswith(), TARGET_SYSROOT_PREFIX, and warning().
Referenced by _initialize_solib().
void handle_solib_event | ( | void | ) |
Definition at line 1327 of file solib.c.
References auto_solib_add, clear_program_space_solib_cache(), current_inferior(), current_target, target_so_ops::handle_event, solib_add(), solib_ops(), target_gdbarch(), target_terminal_inferior(), and target_terminal_ours_for_output().
Referenced by bpstat_stop_status(), and handle_inferior_event_1().
Definition at line 1280 of file solib.c.
References target_so_ops::in_dynsym_resolve_code, solib_ops(), and target_gdbarch().
Referenced by process_event_stop_test().
|
static |
Definition at line 1055 of file solib.c.
References _, so_list::addr_high, so_list::addr_low, current_uiout, do_cleanups(), error(), gdbarch_ptr_bit(), interp_ui_out(), make_cleanup_ui_out_table_begin_end(), make_cleanup_ui_out_tuple_begin_end(), so_list::next, so_list::objfile, objfile_has_symbols(), re_comp(), so_list_head, so_list::so_name, so_list::symbols_loaded, target_gdbarch(), top_level_interpreter(), ui_left, ui_noalign, ui_out_field_core_addr(), ui_out_field_skip(), ui_out_field_string(), ui_out_is_mi_like_p(), ui_out_message(), ui_out_table_body(), ui_out_table_header(), ui_out_text(), and update_solib_list().
Referenced by _initialize_solib().
Definition at line 942 of file solib.c.
Referenced by has_libpthread(), libpthread_solib_p(), thread_db_new_objfile(), and try_thread_db_load_from_pdir().
Definition at line 950 of file solib.c.
References libpthread_name_p(), and so_list::so_name.
Referenced by reload_shared_libraries_1(), and solib_add().
struct so_list* master_so_list | ( | void | ) |
Definition at line 659 of file solib.c.
References so_list_head.
Referenced by enable_break(), free_all_objfiles(), frv_fdpic_find_canonical_descriptor(), frv_fdpic_find_global_pointer(), frv_fetch_objfile_link_map(), and svr4_fetch_objfile_link_map().
void no_shared_libraries | ( | char * | ignored, |
int | from_tty | ||
) |
Definition at line 1302 of file solib.c.
References clear_solib(), and objfile_purge_solibs().
Referenced by _initialize_solib(), detach_command(), disconnect_command(), follow_exec(), release_program_space(), remote_open_1(), symbol_file_clear(), and target_pre_inferior().
|
static |
Definition at line 1419 of file solib.c.
References auto_solib_add, breakpoint_re_set(), target_so_ops::clear_solib, reinit_frame_cache(), reload_shared_libraries_1(), remove_solib_event_breakpoints(), solib_add(), solib_create_inferior_hook(), solib_ops(), target_so_ops::special_symbol_handling, target_gdbarch(), and target_has_execution.
Referenced by _initialize_solib(), and gdb_sysroot_changed().
|
static |
Definition at line 1348 of file solib.c.
References _, auto_solib_add, CATCH, clear_so(), do_cleanups(), END_CATCH, exception_fprintf(), objfile::flags, flags, free_objfile(), gdb_bfd_unref(), gdb_stderr, libpthread_solib_p(), make_cleanup(), so_list::next, null_cleanup(), OBJF_USERLOADED, so_list::objfile, print_symbol_loading_p(), printf_unfiltered(), remove_target_sections(), RETURN_MASK_ERROR, so_list_head, so_list::so_name, so_list::so_original_name, solib_bfd_open(), solib_map_sections(), solib_read_symbols(), solib_used(), so_list::symbols_loaded, SYMFILE_DEFER_BP_RESET, SYMFILE_VERBOSE, TRY, and xfree().
Referenced by reload_shared_libraries().
|
static |
Definition at line 1648 of file solib.c.
References objfile::flags, so_list::next, OBJF_USERLOADED, so_list::objfile, and so_list_head.
Referenced by _initialize_solib().
void set_solib_ops | ( | struct gdbarch * | gdbarch, |
const struct target_so_ops * | new_ops | ||
) |
Definition at line 76 of file solib.c.
References gdbarch_data().
Referenced by arm_symbian_init_abi(), dicos_init_abi(), frv_gdbarch_init(), i386_darwin_init_abi(), i386nto_init_abi(), mips_linux_init_abi(), rs6000_aix_init_osabi(), set_solib_svr4_fetch_link_map_offsets(), set_spu_solib_ops(), tic6x_uclinux_init_abi(), windows_init_abi(), and x86_darwin_init_abi_64().
|
static |
Definition at line 1290 of file solib.c.
References dont_repeat(), and solib_add().
Referenced by _initialize_solib().
|
static |
Definition at line 1503 of file solib.c.
References _, and fprintf_filtered().
Referenced by _initialize_solib().
|
static |
Definition at line 100 of file solib.c.
References _, and fprintf_filtered().
Referenced by _initialize_solib().
void solib_add | ( | const char * | pattern, |
int | from_tty, | ||
struct target_ops * | target, | ||
int | readsyms | ||
) |
Definition at line 965 of file solib.c.
References _, breakpoint_re_set(), current_program_space, error(), flags, info_verbose, libpthread_solib_p(), so_list::next, print_symbol_loading_p(), printf_unfiltered(), re_comp(), reinit_frame_cache(), so_list_head, so_list::so_name, program_space::solib_add_generation, solib_ops(), solib_read_symbols(), target_so_ops::special_symbol_handling, so_list::symbols_loaded, SYMFILE_DEFER_BP_RESET, SYMFILE_VERBOSE, target_gdbarch(), and update_solib_list().
Referenced by enable_break(), frv_fetch_objfile_link_map(), handle_solib_event(), post_create_inferior(), reload_shared_libraries(), remote_start_remote(), sharedlibrary_command(), and svr4_fetch_objfile_link_map().
bfd* solib_bfd_fopen | ( | char * | pathname, |
int | fd | ||
) |
Definition at line 459 of file solib.c.
References _, error(), gdb_bfd_has_target_filename(), gdb_bfd_open(), gnutarget, make_cleanup(), and xfree().
Referenced by darwin_bfd_open(), and solib_bfd_open().
bfd* solib_bfd_open | ( | char * | pathname | ) |
Definition at line 481 of file solib.c.
References _, error(), gdbarch_bfd_arch_info(), make_cleanup_bfd_unref(), perror_with_name(), solib_bfd_fopen(), solib_find(), target_gdbarch(), and warning().
Referenced by _initialize_dsbt_solib(), _initialize_frv_solib(), _initialize_solib_target(), _initialize_svr4_solib(), enable_break(), enable_break2(), reload_shared_libraries_1(), and solib_aix_bfd_open().
Definition at line 1167 of file solib.c.
References target_section::addr, target_section::endaddr, and so_list::sections.
Referenced by disable_breakpoints_in_unloaded_shlib(), and solib_name_from_address().
void solib_create_inferior_hook | ( | int | from_tty | ) |
Definition at line 1269 of file solib.c.
References target_so_ops::solib_create_inferior_hook, solib_ops(), and target_gdbarch().
Referenced by follow_exec(), follow_fork_inferior(), post_create_inferior(), procfs_create_inferior(), procfs_post_attach(), and reload_shared_libraries().
char* solib_find | ( | char * | in_pathname, |
int * | fd | ||
) |
Definition at line 419 of file solib.c.
References gdbarch_solib_symbols_extension(), solib_find_1(), and target_gdbarch().
Referenced by darwin_bfd_open(), and solib_bfd_open().
Definition at line 153 of file solib.c.
References current_inferior(), do_cleanups(), DOS_BASED_FILE_SYSTEM, effective_target_file_system_kind(), file_system_kind_dos_based, target_so_ops::find_and_open_solib, gdb_open_cloexec(), gdb_sysroot, get_in_environ(), HAS_TARGET_DRIVE_SPEC, IS_TARGET_ABSOLUTE_PATH, IS_TARGET_DIR_SEPARATOR, is_target_filename(), make_cleanup(), null_cleanup(), O_BINARY, openp(), OPF_RETURN_REALPATH, OPF_TRY_CWD_FIRST, savestring(), SLASH_STRING, solib_ops(), solib_search_path, target_filesystem_is_local, target_gdbarch(), target_lbasename(), TARGET_SYSROOT_PREFIX, and xfree().
Referenced by exec_file_find(), and solib_find().
struct symbol* solib_global_lookup | ( | struct objfile * | objfile, |
const char * | name, | ||
const domain_enum | domain | ||
) |
Definition at line 1515 of file solib.c.
References get_objfile_arch(), target_so_ops::lookup_lib_global_symbol, and solib_ops().
Referenced by lookup_global_symbol().
|
static |
Definition at line 56 of file solib.c.
References current_target_so_ops, and OBSTACK_ZALLOC.
Referenced by _initialize_solib().
Definition at line 1209 of file solib.c.
References target_so_ops::keep_data_in_core, solib_ops(), and target_gdbarch().
Referenced by gcore_create_callback().
Definition at line 534 of file solib.c.
References _, so_list::abfd, add_target_sections(), target_section::addr, so_list::addr_high, so_list::addr_low, target_so_ops::bfd_open, build_section_table(), do_cleanups(), target_section::endaddr, error(), make_cleanup(), target_so_ops::relocate_section_addresses, so_list::sections, so_list::sections_end, so_list::so_name, SO_NAME_MAX_PATH_SIZE, solib_ops(), target_gdbarch(), target_section::the_bfd_section, and xfree().
Referenced by reload_shared_libraries_1(), and update_solib_list().
char* solib_name_from_address | ( | struct program_space * | pspace, |
CORE_ADDR | address | ||
) |
Definition at line 1191 of file solib.c.
References so_list::next, program_space::so_list, so_list::so_name, and solib_contains_address_p().
Referenced by disable_breakpoints_in_shlibs(), gdbpy_solib_name(), insert_bp_location(), print_frame(), and remove_breakpoint_1().
|
static |
Definition at line 66 of file solib.c.
References gdbarch_data().
Referenced by clear_so(), clear_solib(), free_so(), handle_solib_event(), in_solib_dynsym_resolve_code(), reload_shared_libraries(), solib_add(), solib_create_inferior_hook(), solib_find_1(), solib_global_lookup(), solib_keep_data_in_core(), solib_map_sections(), update_solib_breakpoints(), and update_solib_list().
Definition at line 669 of file solib.c.
References _, so_list::abfd, so_list::addr_low, objfile::addr_low, ALL_OBJFILES, build_section_addr_info_from_section_table(), CATCH, current_inferior(), END_CATCH, exception_fprintf(), free_section_addr_info(), gdb_stderr, OBJF_SHARED, so_list::objfile, objfile_name(), RETURN_MASK_ERROR, so_list::sections, so_list::sections_end, so_list::so_name, symbol_file_add_from_bfd(), so_list::symbols_loaded, inferior::symfile_flags, and TRY.
Referenced by bsd_uthread_solib_loaded(), ppc_linux_spe_context_solib_loaded(), reload_shared_libraries_1(), solib_add(), and spu_solib_loaded().
Definition at line 727 of file solib.c.
References so_list::next, so_list::objfile, and so_list_head.
Referenced by reload_shared_libraries_1(), and update_solib_list().
void update_solib_breakpoints | ( | void | ) |
Definition at line 1316 of file solib.c.
References solib_ops(), target_gdbarch(), and target_so_ops::update_breakpoints.
Referenced by set_stop_on_solib_events().
|
static |
Definition at line 761 of file solib.c.
References _, inferior::attach_flag, CATCH, catch_errors(), current_inferior(), current_program_space, target_so_ops::current_sos, END_CATCH, exception_fprintf(), objfile::flags, free_objfile(), free_so(), gdb_stderr, inferior_ptid, so_list::next, null_ptid, OBJF_USERLOADED, so_list::objfile, observer_notify_solib_loaded(), observer_notify_solib_unloaded(), target_so_ops::open_symbol_file_object, so_list::pspace, ptid_equal(), remove_target_sections(), RETURN_MASK_ALL, RETURN_MASK_ERROR, target_so_ops::same, so_list_head, so_list::so_name, so_list::so_original_name, solib_map_sections(), solib_ops(), solib_used(), symfile_objfile, target_gdbarch(), target_has_execution, TRY, VEC_safe_push, and warning().
Referenced by info_sharedlibrary_command(), and solib_add().
initialize_file_ftype _initialize_solib |
struct target_so_ops* current_target_so_ops |
Definition at line 88 of file solib.c.
Referenced by _initialize_solib_target(), and solib_init().
|
static |
|
static |
Definition at line 98 of file solib.c.
Referenced by _initialize_solib(), and solib_find_1().