GDB (xrefs)
|
#include "defs.h"
#include <sys/types.h>
#include <fcntl.h>
#include "gdb_string.h"
#include "symtab.h"
#include "bfd.h"
#include "symfile.h"
#include "objfiles.h"
#include "exceptions.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.
#define DOS_BASED_FILE_SYSTEM 0 |
Definition at line 114 of file solib.c.
Referenced by solib_find().
#define so_list_head current_program_space->so_list |
Definition at line 93 of file solib.c.
Referenced by clear_solib(), info_sharedlibrary_command(), master_so_list(), reload_shared_libraries_1(), solib_add(), solib_used(), and update_solib_list().
void _initialize_solib | ( | void | ) |
Definition at line 1502 of file solib.c.
References _, add_alias_cmd(), add_com(), add_info(), add_setshow_boolean_cmd(), add_setshow_filename_cmd(), add_setshow_optional_filename_cmd(), auto_solib_add, class_files, class_support, gdb_sysroot, gdbarch_data_register_pre_init(), info_sharedlibrary_command(), no_shared_libraries(), reload_shared_libraries(), setlist, sharedlibrary_command(), show_auto_solib_add(), show_solib_search_path(), showlist, solib_init(), and solib_search_path.
static CORE_ADDR bfd_lookup_symbol_from_dyn_symtab | ( | bfd * | abfd, |
int(*)(asymbol *, void *) | match_sym, | ||
void * | data | ||
) | [static] |
Definition at line 1447 of file solib.c.
References do_cleanups(), make_cleanup(), xfree(), and xmalloc().
Referenced by gdb_bfd_lookup_symbol().
Definition at line 532 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 1139 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().
Definition at line 572 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(), som_current_sos(), svr4_free_library_list(), and update_solib_list().
CORE_ADDR gdb_bfd_lookup_symbol | ( | bfd * | abfd, |
int(*)(asymbol *, void *) | match_sym, | ||
void * | data | ||
) |
Definition at line 1485 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 1408 of file solib.c.
References do_cleanups(), make_cleanup(), xfree(), and xmalloc().
Referenced by gdb_bfd_lookup_symbol().
void handle_solib_event | ( | void | ) |
Definition at line 1244 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().
Definition at line 1197 of file solib.c.
References target_so_ops::in_dynsym_resolve_code, solib_ops(), and target_gdbarch().
Referenced by handle_inferior_event().
static void info_sharedlibrary_command | ( | char * | pattern, |
int | from_tty | ||
) | [static] |
Definition at line 972 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().
int libpthread_name_p | ( | const char * | name | ) |
Definition at line 870 of file solib.c.
References strstr().
Referenced by has_libpthread(), libpthread_solib_p(), thread_db_new_objfile(), and try_thread_db_load_from_pdir().
static int libpthread_solib_p | ( | struct so_list * | so | ) | [static] |
Definition at line 878 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 | ) | [read] |
Definition at line 585 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(), som_solib_get_got_by_pc(), som_solib_get_solib_by_pc(), som_solib_section_offsets(), and svr4_fetch_objfile_link_map().
void no_shared_libraries | ( | char * | ignored, |
int | from_tty | ||
) |
Definition at line 1219 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 void reload_shared_libraries | ( | char * | ignored, |
int | from_tty, | ||
struct cmd_list_element * | e | ||
) | [static] |
Definition at line 1325 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().
static void reload_shared_libraries_1 | ( | int | from_tty | ) | [static] |
Definition at line 1265 of file solib.c.
References _, auto_solib_add, clear_so(), do_cleanups(), exception_fprintf(), flags, objfile::flags, free_objfile(), gdb_bfd_unref(), gdb_stderr, libpthread_solib_p(), make_cleanup(), so_list::next, null_cleanup(), OBJF_USERLOADED, so_list::objfile, gdb_exception::reason, 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_CATCH, and xfree().
Referenced by reload_shared_libraries().
void set_solib_ops | ( | struct gdbarch * | gdbarch, |
const struct target_so_ops * | new_ops | ||
) |
Definition at line 78 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(), ia64_hpux_init_abi(), mips_irix_init_abi(), mips_linux_init_abi(), ppc_linux_init_abi(), rs6000_aix_init_osabi(), set_solib_svr4_fetch_link_map_offsets(), set_spu_solib_ops(), som_solib_select(), tic6x_uclinux_init_abi(), windows_init_abi(), and x86_darwin_init_abi_64().
static void sharedlibrary_command | ( | char * | args, |
int | from_tty | ||
) | [static] |
Definition at line 1207 of file solib.c.
References dont_repeat(), and solib_add().
Referenced by _initialize_solib().
static void show_auto_solib_add | ( | struct ui_file * | file, |
int | from_tty, | ||
struct cmd_list_element * | c, | ||
const char * | value | ||
) | [static] |
Definition at line 1379 of file solib.c.
References _, and fprintf_filtered().
Referenced by _initialize_solib().
static void show_solib_search_path | ( | struct ui_file * | file, |
int | from_tty, | ||
struct cmd_list_element * | c, | ||
const char * | value | ||
) | [static] |
Definition at line 102 of file solib.c.
References _, and fprintf_filtered().
Referenced by _initialize_solib().
void solib_add | ( | char * | pattern, |
int | from_tty, | ||
struct target_ops * | target, | ||
int | readsyms | ||
) |
Definition at line 893 of file solib.c.
References _, breakpoint_re_set(), current_program_space, error(), flags, info_verbose, libpthread_solib_p(), so_list::next, 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(), ia64_hpux_handle_dld_breakpoint_1(), ia64_hpux_solib_add_after_attach(), irix_solib_create_inferior_hook(), osf_solib_create_inferior_hook(), 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 385 of file solib.c.
References _, error(), gdb_assert, gdb_bfd_open(), gnutarget, make_cleanup(), remote_bfd_open(), remote_filename_p(), and xfree().
Referenced by darwin_bfd_open(), and solib_bfd_open().
bfd* solib_bfd_open | ( | char * | pathname | ) |
Definition at line 417 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_irix_solib(), _initialize_osf_solib(), _initialize_solib_target(), _initialize_som_solib(), _initialize_svr4_solib(), enable_break(), enable_break2(), ia64_hpux_target_so_ops(), reload_shared_libraries_1(), and solib_aix_bfd_open().
Definition at line 1084 of file solib.c.
References target_section::addr, target_section::endaddr, p, so_list::sections, and sections_end.
Referenced by disable_breakpoints_in_unloaded_shlib(), and solib_name_from_address().
void solib_create_inferior_hook | ( | int | from_tty | ) |
Definition at line 1186 of file solib.c.
References target_so_ops::solib_create_inferior_hook, solib_ops(), and target_gdbarch().
Referenced by follow_exec(), linux_child_follow_fork(), post_create_inferior(), procfs_create_inferior(), procfs_post_attach(), and reload_shared_libraries().
char* solib_find | ( | char * | in_pathname, |
int * | fd | ||
) |
Definition at line 145 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, gdbarch_solib_symbols_extension(), get_in_environ(), HAS_TARGET_DRIVE_SPEC, IS_TARGET_ABSOLUTE_PATH, IS_TARGET_DIR_SEPARATOR, make_cleanup(), memcpy(), null_cleanup(), openp(), OPF_RETURN_REALPATH, OPF_TRY_CWD_FIRST, p, remote_filename_p(), REMOTE_SYSROOT_PREFIX, savestring(), solib_ops(), solib_search_path, target_gdbarch(), target_lbasename(), and xfree().
Referenced by darwin_bfd_open(), and solib_bfd_open().
struct symbol* solib_global_lookup | ( | const struct objfile * | objfile, |
const char * | name, | ||
const domain_enum | domain | ||
) | [read] |
Definition at line 1391 of file solib.c.
References target_so_ops::lookup_lib_global_symbol, solib_ops(), and target_gdbarch().
Referenced by lookup_symbol_global().
static void* solib_init | ( | struct obstack * | obstack | ) | [static] |
Definition at line 58 of file solib.c.
References current_target_so_ops, and OBSTACK_ZALLOC.
Referenced by _initialize_solib().
int solib_keep_data_in_core | ( | CORE_ADDR | vaddr, |
unsigned long | size | ||
) |
Definition at line 1126 of file solib.c.
References target_so_ops::keep_data_in_core, solib_ops(), and target_gdbarch().
Referenced by gcore_create_callback().
static int solib_map_sections | ( | struct so_list * | so | ) | [static] |
Definition at line 470 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(), p, target_so_ops::relocate_section_addresses, so_list::sections, sections_end, so_list::sections_end, so_list::so_name, 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 1108 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(), get_frame_name(), insert_bp_location(), print_frame(), and remove_breakpoint_1().
static struct target_so_ops* solib_ops | ( | struct gdbarch * | gdbarch | ) | [static, read] |
Definition at line 68 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(), solib_global_lookup(), solib_keep_data_in_core(), solib_map_sections(), update_solib_breakpoints(), and update_solib_list().
int solib_read_symbols | ( | struct so_list * | so, |
int | flags | ||
) |
Definition at line 595 of file solib.c.
References _, so_list::abfd, so_list::addr_low, objfile::addr_low, ALL_OBJFILES, build_section_addr_info_from_section_table(), current_inferior(), exception_fprintf(), free_section_addr_info(), gdb_stderr, info_verbose, OBJF_SHARED, so_list::objfile, objfile_name(), printf_unfiltered(), gdb_exception::reason, 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, SYMFILE_VERBOSE, and TRY_CATCH.
Referenced by bsd_uthread_solib_loaded(), ppc_linux_spe_context_solib_loaded(), reload_shared_libraries_1(), solib_add(), and spu_solib_loaded().
static int solib_used | ( | const struct so_list *const | known | ) | [static] |
Definition at line 657 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 1233 of file solib.c.
References solib_ops(), target_gdbarch(), and target_so_ops::update_breakpoints.
Referenced by set_stop_on_solib_events().
static void update_solib_list | ( | int | from_tty, |
struct target_ops * | target | ||
) | [static] |
Definition at line 691 of file solib.c.
References _, inferior::attach_flag, catch_errors(), current_inferior(), current_program_space, target_so_ops::current_sos, 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(), gdb_exception::reason, 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_CATCH, VEC_safe_push, and warning().
Referenced by info_sharedlibrary_command(), and solib_add().
Referenced by initialize_all_files().
struct target_so_ops* current_target_so_ops |
Definition at line 90 of file solib.c.
Referenced by _initialize_osf_solib(), _initialize_solib_target(), and solib_init().
struct gdbarch_data* solib_data [static] |
char* solib_search_path = NULL [static] |
Definition at line 100 of file solib.c.
Referenced by _initialize_solib(), and solib_find().