GDB (xrefs)
|
#include "defs.h"
#include "gdb_bfd.h"
#include "ui-out.h"
#include "gdbcmd.h"
#include "hashtab.h"
#include "filestuff.h"
#include "vec.h"
#include <sys/mman.h>
#include "target.h"
#include "gdb/fileio.h"
#include "inferior.h"
Go to the source code of this file.
Classes | |
struct | gdb_bfd_section_data |
struct | gdb_bfd_data |
struct | gdb_bfd_cache_search |
Macros | |
#define | MAP_FAILED ((void *) -1) |
#define | GDB_BFD_DATA_ACCESSOR(ABFD) ((struct gdb_bfd_data *) bfd_usrdata (ABFD)) |
Typedefs | |
typedef bfd * | bfdp |
Functions | |
DEF_VEC_P (bfdp) | |
static hashval_t | hash_bfd (const void *b) |
static int | eq_bfd (const void *a, const void *b) |
int | is_target_filename (const char *name) |
int | gdb_bfd_has_target_filename (struct bfd *abfd) |
static int | fileio_errno_to_host (int errnum) |
static void * | gdb_bfd_iovec_fileio_open (struct bfd *abfd, void *inferior) |
static file_ptr | gdb_bfd_iovec_fileio_pread (struct bfd *abfd, void *stream, void *buf, file_ptr nbytes, file_ptr offset) |
static int | gdb_bfd_iovec_fileio_close (struct bfd *abfd, void *stream) |
static int | gdb_bfd_iovec_fileio_fstat (struct bfd *abfd, void *stream, struct stat *sb) |
struct bfd * | gdb_bfd_open (const char *name, const char *target, int fd) |
static void | free_one_bfd_section (bfd *abfd, asection *sectp, void *ignore) |
static int | gdb_bfd_close_or_warn (struct bfd *abfd) |
void | gdb_bfd_ref (struct bfd *abfd) |
void | gdb_bfd_unref (struct bfd *abfd) |
static struct gdb_bfd_section_data * | get_section_descriptor (asection *section) |
const gdb_byte * | gdb_bfd_map_section (asection *sectp, bfd_size_type *size) |
static int | get_file_crc (bfd *abfd, unsigned long *file_crc_return) |
int | gdb_bfd_crc (struct bfd *abfd, unsigned long *crc_out) |
bfd * | gdb_bfd_fopen (const char *filename, const char *target, const char *mode, int fd) |
bfd * | gdb_bfd_openr (const char *filename, const char *target) |
bfd * | gdb_bfd_openw (const char *filename, const char *target) |
bfd * | gdb_bfd_openr_iovec (const char *filename, const char *target, void *(*open_func)(struct bfd *nbfd, void *open_closure), void *open_closure, file_ptr(*pread_func)(struct bfd *nbfd, void *stream, void *buf, file_ptr nbytes, file_ptr offset), int(*close_func)(struct bfd *nbfd, void *stream), int(*stat_func)(struct bfd *abfd, void *stream, struct stat *sb)) |
void | gdb_bfd_mark_parent (bfd *child, bfd *parent) |
bfd * | gdb_bfd_openr_next_archived_file (bfd *archive, bfd *previous) |
void | gdb_bfd_record_inclusion (bfd *includer, bfd *includee) |
bfd * | gdb_bfd_fdopenr (const char *filename, const char *target, int fd) |
gdb_static_assert (ARRAY_SIZE(_bfd_std_section)==4) | |
int | gdb_bfd_section_index (bfd *abfd, asection *section) |
int | gdb_bfd_count_sections (bfd *abfd) |
int | gdb_bfd_requires_relocations (bfd *abfd) |
static int | print_one_bfd (void **slot, void *data) |
static void | maintenance_info_bfds (char *arg, int from_tty) |
void | _initialize_gdb_bfd (void) |
Variables | |
static htab_t | all_bfds |
static htab_t | gdb_bfd_cache |
initialize_file_ftype | _initialize_gdb_bfd |
#define GDB_BFD_DATA_ACCESSOR | ( | ABFD | ) | ((struct gdb_bfd_data *) bfd_usrdata (ABFD)) |
#define MAP_FAILED ((void *) -1) |
Definition at line 30 of file gdb_bfd.c.
Referenced by gdb_bfd_map_section(), and linux_ptrace_test_ret_to_nx().
void _initialize_gdb_bfd | ( | void | ) |
Definition at line 898 of file gdb_bfd.c.
References _, add_cmd(), all_bfds, class_maintenance, maintenance_info_bfds(), maintenanceinfolist, xcalloc(), and xfree().
DEF_VEC_P | ( | bfdp | ) |
Definition at line 132 of file gdb_bfd.c.
References gdb_bfd_cache_search::filename, gdb_bfd_data::mtime, and gdb_bfd_cache_search::mtime.
Referenced by gdb_bfd_open().
Definition at line 162 of file gdb_bfd.c.
Referenced by gdb_bfd_iovec_fileio_fstat(), gdb_bfd_iovec_fileio_open(), and gdb_bfd_iovec_fileio_pread().
|
static |
Definition at line 397 of file gdb_bfd.c.
References gdb_bfd_section_data::data, gdb_assert, gdb_bfd_section_data::map_addr, gdb_bfd_section_data::map_len, and xfree().
Referenced by gdb_bfd_close_or_warn().
|
static |
Definition at line 420 of file gdb_bfd.c.
References _, free_one_bfd_section(), name, and warning().
Referenced by gdb_bfd_unref().
int gdb_bfd_count_sections | ( | bfd * | abfd | ) |
Definition at line 824 of file gdb_bfd.c.
Referenced by build_objfile_section_table(), default_symfile_offsets(), objfile_relocate(), solib_target_relocate_section_addresses(), and syms_from_objfile_1().
int gdb_bfd_crc | ( | struct bfd * | abfd, |
unsigned long * | crc_out | ||
) |
Definition at line 658 of file gdb_bfd.c.
References gdb_bfd_data::crc, gdb_bfd_data::crc_computed, and get_file_crc().
Referenced by separate_debug_file_exists().
Definition at line 789 of file gdb_bfd.c.
References gdb_bfd_ref().
Definition at line 675 of file gdb_bfd.c.
References gdb_bfd_ref().
Referenced by core_open(), and exec_file_attach().
int gdb_bfd_has_target_filename | ( | struct bfd * | abfd | ) |
Definition at line 153 of file gdb_bfd.c.
References is_target_filename().
Referenced by solib_bfd_fopen(), and symfile_bfd_open().
|
static |
Definition at line 281 of file gdb_bfd.c.
References target_fileio_close(), and xfree().
Referenced by gdb_bfd_open().
|
static |
Definition at line 300 of file gdb_bfd.c.
References fileio_errno_to_host(), and target_fileio_fstat().
Referenced by gdb_bfd_open().
|
static |
Definition at line 217 of file gdb_bfd.c.
References fileio_errno_to_host(), gdb_assert, is_target_filename(), target_fileio_open_warn_if_slow(), and TARGET_SYSROOT_PREFIX.
Referenced by gdb_bfd_open().
|
static |
Definition at line 246 of file gdb_bfd.c.
References fileio_errno_to_host(), QUIT, and target_fileio_pread().
Referenced by gdb_bfd_open().
Definition at line 547 of file gdb_bfd.c.
References _, gdb_bfd_section_data::data, error(), gdb_assert, get_section_descriptor(), gdb_bfd_section_data::map_addr, MAP_FAILED, gdb_bfd_section_data::map_len, and gdb_bfd_section_data::size.
Referenced by dwarf2_read_section().
void gdb_bfd_mark_parent | ( | bfd * | child, |
bfd * | parent | ||
) |
Definition at line 743 of file gdb_bfd.c.
References gdb_bfd_data::archive_bfd, gdb_assert, and gdb_bfd_ref().
Referenced by gdb_bfd_mach_o_fat_extract(), and gdb_bfd_openr_next_archived_file().
Definition at line 320 of file gdb_bfd.c.
References current_inferior(), eq_bfd(), gdb_bfd_cache_search::filename, gdb_assert, gdb_bfd_cache, gdb_bfd_iovec_fileio_close(), gdb_bfd_iovec_fileio_fstat(), gdb_bfd_iovec_fileio_open(), gdb_bfd_iovec_fileio_pread(), gdb_bfd_openr_iovec(), gdb_bfd_ref(), gdb_open_cloexec(), hash(), hash_bfd(), is_target_filename(), gdb_bfd_cache_search::mtime, name, O_BINARY, target_filesystem_is_local, TARGET_SYSROOT_PREFIX, xcalloc(), and xfree().
Referenced by build_id_to_debug_bfd(), compile_object_load(), darwin_solib_get_all_image_info_addr_at_init(), dwarf2_get_dwz_file(), exec_file_attach(), generic_load(), load_srec(), m32r_load(), m32r_upload_command(), macho_symfile_read_all_oso(), mips_load_srec(), pmon_load_fast(), reread_symbols(), separate_debug_file_exists(), solib_aix_bfd_open(), solib_bfd_fopen(), symfile_bfd_open(), try_open_dwop_file(), windows_make_so(), and windows_xfer_shared_library().
Definition at line 689 of file gdb_bfd.c.
References gdb_bfd_ref().
Referenced by bfd_openr_with_cleanup(), and macho_check_dsym().
bfd* gdb_bfd_openr_iovec | ( | const char * | filename, |
const char * | target, | ||
void *(*)(struct bfd *nbfd, void *open_closure) | open_func, | ||
void * | open_closure, | ||
file_ptr(*)(struct bfd *nbfd, void *stream, void *buf, file_ptr nbytes, file_ptr offset) | pread_func, | ||
int(*)(struct bfd *nbfd, void *stream) | close_func, | ||
int(*)(struct bfd *abfd, void *stream, struct stat *sb) | stat_func | ||
) |
Definition at line 715 of file gdb_bfd.c.
References gdb_bfd_ref().
Referenced by bfd_open_from_target_memory(), find_separate_debug_file_in_section(), gdb_bfd_open(), spu_bfd_fopen(), and spu_bfd_open().
bfd* gdb_bfd_openr_next_archived_file | ( | bfd * | archive, |
bfd * | previous | ||
) |
Definition at line 764 of file gdb_bfd.c.
References gdb_bfd_mark_parent().
Referenced by macho_symfile_read_all_oso(), and solib_aix_bfd_open().
Definition at line 702 of file gdb_bfd.c.
References gdb_bfd_ref().
Referenced by bfd_openw_with_cleanup(), and create_gcore_bfd().
void gdb_bfd_record_inclusion | ( | bfd * | includer, |
bfd * | includee | ||
) |
Definition at line 777 of file gdb_bfd.c.
References gdb_bfd_ref(), and VEC_safe_push.
Referenced by dwarf2_get_dwz_file(), and try_open_dwop_file().
void gdb_bfd_ref | ( | struct bfd * | abfd | ) |
Definition at line 439 of file gdb_bfd.c.
References all_bfds, gdb_bfd_data::archive_bfd, gdb_assert, gdb_bfd_data::mtime, and gdb_bfd_data::refc.
Referenced by allocate_objfile(), exec_file_attach(), gdb_bfd_fdopenr(), gdb_bfd_fopen(), gdb_bfd_mach_o_fat_extract(), gdb_bfd_mark_parent(), gdb_bfd_open(), gdb_bfd_openr(), gdb_bfd_openr_iovec(), gdb_bfd_openw(), gdb_bfd_record_inclusion(), symbol_file_add_from_memory(), and target_bfd_reopen().
int gdb_bfd_requires_relocations | ( | bfd * | abfd | ) |
Definition at line 832 of file gdb_bfd.c.
References gdb_bfd_data::needs_relocations, and gdb_bfd_data::relocation_computed.
Referenced by get_objfile_bfd_data().
int gdb_bfd_section_index | ( | bfd * | abfd, |
asection * | section | ||
) |
Definition at line 806 of file gdb_bfd.c.
Referenced by add_to_objfile_sections_full(), build_section_addr_info_from_bfd(), build_section_addr_info_from_section_table(), cs_to_section(), elf_symtab_read(), find_targ_sec(), init_entry_point_info(), macho_symtab_add_minsym(), place_section(), print_bfd_section_info(), record_minimal_symbol(), and solib_target_relocate_section_addresses().
void gdb_bfd_unref | ( | struct bfd * | abfd | ) |
Definition at line 475 of file gdb_bfd.c.
References all_bfds, gdb_bfd_data::archive_bfd, gdb_bfd_cache_search::filename, gdb_assert, gdb_bfd_cache, gdb_bfd_close_or_warn(), gdb_bfd_unref(), hash(), gdb_bfd_data::mtime, gdb_bfd_cache_search::mtime, gdb_bfd_data::refc, VEC_free, and VEC_iterate.
Referenced by build_id_to_debug_bfd(), clear_so(), core_close(), darwin_bfd_open(), do_bfd_close_cleanup(), do_bfd_delete_cleanup(), dwarf2_get_dwz_file(), dwarf2_per_objfile_free(), enable_break(), enable_break2(), exec_close(), find_separate_debug_file_by_buildid(), find_separate_debug_file_in_section(), free_dwo_file(), free_objfile(), gcore_command(), gdb_bfd_unref(), jit_bfd_try_read_symtab(), macho_add_oso_symfile(), macho_check_dsym(), macho_symfile_read_all_oso(), record_full_save(), record_full_save_cleanups(), reload_shared_libraries_1(), reread_symbols(), separate_debug_file_exists(), solib_aix_bfd_open(), spu_bfd_fopen(), spu_bfd_open(), target_bfd_xclose(), try_open_dwop_file(), windows_make_so(), and windows_xfer_shared_library().
gdb_static_assert | ( | ARRAY_SIZE(_bfd_std_section) | = =4 | ) |
|
static |
|
static |
Definition at line 529 of file gdb_bfd.c.
Referenced by gdb_bfd_map_section().
|
static |
Definition at line 120 of file gdb_bfd.c.
Referenced by gdb_bfd_open().
Definition at line 145 of file gdb_bfd.c.
References startswith(), and TARGET_SYSROOT_PREFIX.
Referenced by allocate_objfile(), exec_file_attach(), gdb_bfd_has_target_filename(), gdb_bfd_iovec_fileio_open(), gdb_bfd_open(), gdbsim_open(), load_auto_scripts_for_objfile(), solib_find_1(), and symfile_bfd_open().
|
static |
Definition at line 878 of file gdb_bfd.c.
References all_bfds, current_uiout, do_cleanups(), make_cleanup_ui_out_table_begin_end(), print_one_bfd(), ui_left, ui_out_table_body(), and ui_out_table_header().
Referenced by _initialize_gdb_bfd().
|
static |
Definition at line 858 of file gdb_bfd.c.
References ui_out::data, do_cleanups(), host_address_to_string(), make_cleanup_ui_out_tuple_begin_end(), gdb_bfd_data::refc, ui_out_field_int(), ui_out_field_string(), and ui_out_text().
Referenced by maintenance_info_bfds().
initialize_file_ftype _initialize_gdb_bfd |
|
static |
Definition at line 60 of file gdb_bfd.c.
Referenced by _initialize_gdb_bfd(), gdb_bfd_ref(), gdb_bfd_unref(), and maintenance_info_bfds().
|
static |
Definition at line 103 of file gdb_bfd.c.
Referenced by gdb_bfd_open(), and gdb_bfd_unref().