GDB (xrefs)
|
#include "defs.h"
#include "gdb_bfd.h"
#include "ui-out.h"
#include "gdbcmd.h"
#include "hashtab.h"
#include "gdbsupport/filestuff.h"
#include "target.h"
#include "gdbsupport/fileio.h"
#include "inferior.h"
#include "cli/cli-style.h"
#include <unordered_map>
Go to the source code of this file.
Classes | |
struct | gdb_bfd_section_data |
struct | gdb_bfd_data |
struct | gdb_bfd_cache_search |
struct | target_buffer |
struct | target_fileio_stream |
struct | bfd_inferior_data |
Macros | |
#define | bfd_cache_debug_printf(fmt, ...) debug_prefixed_printf_cond (debug_bfd_cache, "bfd-cache", fmt, ##__VA_ARGS__) |
#define | AMBIGUOUS_MESS1 ".\nMatching formats:" |
#define | AMBIGUOUS_MESS2 ".\nUse \"set gnutarget format-name\" to specify the format." |
Functions | |
static void | show_bfd_sharing (struct ui_file *file, int from_tty, struct cmd_list_element *c, const char *value) |
static void | show_bfd_cache_debug (struct ui_file *file, int from_tty, struct cmd_list_element *c, const char *value) |
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) |
gdb_bfd_ref_ptr | gdb_bfd_open_from_target_memory (CORE_ADDR addr, ULONGEST size, const char *target) |
static target_fileio_stream * | gdb_bfd_iovec_fileio_open (struct bfd *abfd, inferior *inf, bool warn_if_slow) |
static void | gdb_bfd_close_warning (const char *name, const char *reason) |
static void | gdb_bfd_init_data (struct bfd *abfd, struct stat *st) |
gdb_bfd_ref_ptr | gdb_bfd_open (const char *name, const char *target, int fd, bool warn_if_slow) |
static void | free_one_bfd_section (asection *sectp) |
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) |
gdb_bfd_ref_ptr | gdb_bfd_fopen (const char *filename, const char *target, const char *mode, int fd) |
gdb_bfd_ref_ptr | gdb_bfd_openr (const char *filename, const char *target) |
gdb_bfd_ref_ptr | gdb_bfd_openw (const char *filename, const char *target) |
gdb_bfd_ref_ptr | gdb_bfd_openr_iovec (const char *filename, const char *target, gdb_iovec_opener_ftype open_fn) |
void | gdb_bfd_mark_parent (bfd *child, bfd *parent) |
gdb_bfd_ref_ptr | gdb_bfd_openr_next_archived_file (bfd *archive, bfd *previous) |
void | gdb_bfd_record_inclusion (bfd *includer, bfd *includee) |
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) |
bool | gdb_bfd_get_full_section_contents (bfd *abfd, asection *section, gdb::byte_vector *contents) |
std::string | gdb_bfd_errmsg (bfd_error_type error_tag, char **matching) |
static int | print_one_bfd (void **slot, void *data) |
static void | maintenance_info_bfds (const char *arg, int from_tty) |
static struct bfd_inferior_data * | get_bfd_inferior_data (struct inferior *inf) |
static unsigned long | increment_bfd_error_count (std::string str) |
static void | ATTRIBUTE_PRINTF (1, 0) |
void | _initialize_gdb_bfd () |
Variables | |
static htab_t | all_bfds |
static htab_t | gdb_bfd_cache |
static bool | bfd_sharing = true |
static bool | debug_bfd_cache |
static const registry< inferior >::key< bfd_inferior_data > | bfd_inferior_data_key |
static bfd_error_handler_type | default_bfd_error_handler |
#define AMBIGUOUS_MESS1 ".\nMatching formats:" |
Definition at line 1045 of file gdb_bfd.c.
Referenced by gdb_bfd_errmsg().
#define AMBIGUOUS_MESS2 ".\nUse \"set gnutarget format-name\" to specify the format." |
Definition at line 1046 of file gdb_bfd.c.
Referenced by gdb_bfd_errmsg().
#define bfd_cache_debug_printf | ( | fmt, | |
... ) debug_prefixed_printf_cond (debug_bfd_cache, "bfd-cache", fmt, ##__VA_ARGS__) |
Definition at line 147 of file gdb_bfd.c.
Referenced by gdb_bfd_open(), gdb_bfd_ref(), and gdb_bfd_unref().
void _initialize_gdb_bfd | ( | ) |
Definition at line 1175 of file gdb_bfd.c.
Referenced by initialize_all_files().
|
static |
Definition at line 1154 of file gdb_bfd.c.
References increment_bfd_error_count().
|
static |
Definition at line 190 of file gdb_bfd.c.
References gdb_bfd_data::device_id, gdb_bfd_cache_search::device_id, gdb_bfd_cache_search::filename, gdb_bfd_data::inode, gdb_bfd_cache_search::inode, gdb_bfd_data::mtime, gdb_bfd_cache_search::mtime, gdb_bfd_data::size, and gdb_bfd_cache_search::size.
Referenced by gdb_bfd_open().
|
static |
Definition at line 576 of file gdb_bfd.c.
References gdb_bfd_section_data::data, 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 600 of file gdb_bfd.c.
References free_one_bfd_section(), gdb_bfd_close_warning(), gdb_bfd_sections(), and name.
Referenced by gdb_bfd_unref().
|
static |
Definition at line 404 of file gdb_bfd.c.
References name.
Referenced by gdb_bfd_close_or_warn(), and target_fileio_stream::~target_fileio_stream().
int gdb_bfd_count_sections | ( | bfd * | abfd | ) |
Definition at line 1002 of file gdb_bfd.c.
Referenced by build_objfile_section_table(), default_symfile_offsets(), macho_symfile_offsets(), maint_print_all_sections(), maintenance_info_target_sections(), 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 842 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().
std::string gdb_bfd_errmsg | ( | bfd_error_type | error_tag, |
char ** | matching ) |
Definition at line 1052 of file gdb_bfd.c.
References AMBIGUOUS_MESS1, AMBIGUOUS_MESS2, and xfree().
Referenced by compile_object_load(), exec_file_attach(), and locate_exec_from_corefile_build_id().
gdb_bfd_ref_ptr gdb_bfd_fopen | ( | const char * | filename, |
const char * | target, | ||
const char * | mode, | ||
int | fd ) |
Definition at line 859 of file gdb_bfd.c.
Referenced by core_target_open(), and exec_file_attach().
bool gdb_bfd_get_full_section_contents | ( | bfd * | abfd, |
asection * | section, | ||
gdb::byte_vector * | contents ) |
Definition at line 1034 of file gdb_bfd.c.
Referenced by gdb_bfd_read_elf_soname(), and is_linked_with_cygwin_dll().
int gdb_bfd_has_target_filename | ( | struct bfd * | abfd | ) |
Definition at line 215 of file gdb_bfd.c.
References is_target_filename().
|
static |
Definition at line 451 of file gdb_bfd.c.
References all_bfds, and gdb_bfd_data::gdb_bfd_data().
Referenced by gdb_bfd_open(), and gdb_bfd_ref().
|
static |
Definition at line 345 of file gdb_bfd.c.
References is_target_filename(), target_fileio_open(), and TARGET_SYSROOT_PREFIX.
Referenced by gdb_bfd_open().
const gdb_byte * gdb_bfd_map_section | ( | asection * | sectp, |
bfd_size_type * | size ) |
Definition at line 725 of file gdb_bfd.c.
References gdb_bfd_section_data::data, get_section_descriptor(), gdb_bfd_section_data::map_addr, gdb_bfd_section_data::map_len, gdb_bfd_section_data::size, and size.
Referenced by dwarf2_section_info::read().
void gdb_bfd_mark_parent | ( | bfd * | child, |
bfd * | parent ) |
Definition at line 935 of file gdb_bfd.c.
References gdb_bfd_data::archive_bfd, and gdb_bfd_ref().
Referenced by gdb_bfd_mach_o_fat_extract(), and gdb_bfd_openr_next_archived_file().
gdb_bfd_ref_ptr gdb_bfd_open | ( | const char * | name, |
const char * | target, | ||
int | fd, | ||
bool | warn_if_slow ) |
Definition at line 473 of file gdb_bfd.c.
References bfd_cache_debug_printf, bfd_sharing, current_inferior(), gdb_bfd_cache_search::device_id, eq_bfd(), gdb_bfd_cache_search::filename, gdb_bfd_cache, gdb_bfd_init_data(), gdb_bfd_iovec_fileio_open(), gdb_bfd_openr_iovec(), hash_bfd(), gdb_bfd_cache_search::inode, is_target_filename(), gdb_bfd_cache_search::mtime, name, O_BINARY, gdb_bfd_cache_search::size, target_filesystem_is_local(), TARGET_SYSROOT_PREFIX, xcalloc(), and xfree().
Referenced by build_id_to_debug_bfd_1(), compile_object_load(), darwin_get_dyld_bfd(), dwarf2_get_dwz_file(), dwz_search_other_debugdirs(), exec_file_attach(), gdb_bfd_read_elf_soname(), generic_load(), locate_exec_from_corefile_build_id(), macho_symfile_read_all_oso(), reread_symbols(), separate_debug_file_exists(), solib_bfd_fopen(), symfile_bfd_open(), try_open_dwop_file(), validate_exec_file(), windows_make_so(), and windows_xfer_shared_library().
gdb_bfd_ref_ptr gdb_bfd_open_from_target_memory | ( | CORE_ADDR | addr, |
ULONGEST | size, | ||
const char * | target ) |
Definition at line 301 of file gdb_bfd.c.
References gdb_bfd_openr_iovec(), and size.
Referenced by jit_bfd_try_read_symtab().
gdb_bfd_ref_ptr gdb_bfd_openr | ( | const char * | filename, |
const char * | target ) |
Definition at line 873 of file gdb_bfd.c.
Referenced by bfd_openr_or_error(), and macho_check_dsym().
gdb_bfd_ref_ptr gdb_bfd_openr_iovec | ( | const char * | filename, |
const char * | target, | ||
gdb_iovec_opener_ftype | open_fn ) |
Definition at line 893 of file gdb_bfd.c.
References gdb_bfd_iovec_base::read(), and gdb_bfd_iovec_base::stat().
Referenced by find_separate_debug_file_in_section(), gdb_bfd_open(), gdb_bfd_open_from_target_memory(), and rocm_solib_bfd_open().
gdb_bfd_ref_ptr gdb_bfd_openr_next_archived_file | ( | bfd * | archive, |
bfd * | previous ) |
Definition at line 956 of file gdb_bfd.c.
References gdb_bfd_mark_parent().
Referenced by macho_symfile_read_all_oso(), and solib_aix_bfd_open().
gdb_bfd_ref_ptr gdb_bfd_openw | ( | const char * | filename, |
const char * | target ) |
Definition at line 883 of file gdb_bfd.c.
Referenced by bfd_openw_or_error(), and create_gcore_bfd().
void gdb_bfd_record_inclusion | ( | bfd * | includer, |
bfd * | includee ) |
Definition at line 969 of file gdb_bfd.c.
References gdb_bfd_data::included_bfds.
Referenced by core_target::build_file_mappings(), dwarf2_get_dwz_file(), and try_open_dwop_file().
void gdb_bfd_ref | ( | struct bfd * | abfd | ) |
Definition at line 620 of file gdb_bfd.c.
References bfd_cache_debug_printf, gdb_bfd_init_data(), and gdb_bfd_data::refc.
Referenced by gdb_bfd_mach_o_fat_extract(), gdb_bfd_mark_parent(), and gdb_bfd_ref_policy::incref().
int gdb_bfd_requires_relocations | ( | bfd * | abfd | ) |
Definition at line 1010 of file gdb_bfd.c.
References gdb_bfd_data::needs_relocations, and gdb_bfd_data::relocation_computed.
Referenced by dwarf2_has_info(), find_comp_unit(), set_comp_unit(), and set_objfile_per_bfd().
int gdb_bfd_section_index | ( | bfd * | abfd, |
asection * | section ) |
Definition at line 984 of file gdb_bfd.c.
Referenced by add_to_objfile_sections(), build_section_addr_info_from_bfd(), build_section_addr_info_from_section_table(), cs_to_section(), find_targ_sec(), init_entry_point_info(), macho_symtab_add_minsym(), maint_obj_section_from_bfd_section(), place_section(), print_section_index(), record_minimal_symbol(), objfile::section_offset(), objfile::set_section_offset(), and solib_target_relocate_section_addresses().
void gdb_bfd_unref | ( | struct bfd * | abfd | ) |
Definition at line 647 of file gdb_bfd.c.
References all_bfds, gdb_bfd_data::archive_bfd, bfd_cache_debug_printf, gdb_bfd_data::device_id, gdb_bfd_cache_search::device_id, gdb_bfd_cache_search::filename, gdb_bfd_cache, gdb_bfd_close_or_warn(), gdb_bfd_unref(), gdb_bfd_data::inode, gdb_bfd_cache_search::inode, gdb_bfd_data::mtime, gdb_bfd_cache_search::mtime, gdb_bfd_data::refc, gdb_bfd_data::size, and gdb_bfd_cache_search::size.
Referenced by clear_so(), gdb_bfd_ref_policy::decref(), and gdb_bfd_unref().
gdb_static_assert | ( | ARRAY_SIZE(_bfd_std_section) | = =4 | ) |
|
static |
Definition at line 1125 of file gdb_bfd.c.
References bfd_inferior_data_key, and registry< T >::get().
Referenced by increment_bfd_error_count().
|
static |
|
static |
Definition at line 706 of file gdb_bfd.c.
Referenced by gdb_bfd_map_section().
|
static |
Definition at line 178 of file gdb_bfd.c.
Referenced by gdb_bfd_open().
|
static |
Definition at line 1140 of file gdb_bfd.c.
References bfd_inferior_data::bfd_error_string_counts, current_inferior(), and get_bfd_inferior_data().
Referenced by ATTRIBUTE_PRINTF().
int is_target_filename | ( | const char * | name | ) |
Definition at line 207 of file gdb_bfd.c.
References name, and TARGET_SYSROOT_PREFIX.
Referenced by exec_file_attach(), remote_target::follow_exec(), gdb_bfd_has_target_filename(), gdb_bfd_iovec_fileio_open(), gdb_bfd_open(), gdbsim_target_open(), load_auto_scripts_for_objfile(), objfile::objfile(), solib_find_1(), symfile_bfd_open(), and validate_exec_file().
|
static |
Definition at line 1097 of file gdb_bfd.c.
References all_bfds, current_uiout, print_one_bfd(), ui_out::table_body(), ui_out::table_header(), and ui_left.
|
static |
Definition at line 1078 of file gdb_bfd.c.
References ui_out::field_signed(), ui_out::field_string(), file_name_style, gdb_bfd_data::refc, cli_style_option::style(), and ui_out::text().
Referenced by maintenance_info_bfds().
|
static |
Definition at line 151 of file gdb_bfd.c.
References gdb_printf().
|
static |
Definition at line 135 of file gdb_bfd.c.
References gdb_printf().
|
static |
Definition at line 58 of file gdb_bfd.c.
Referenced by gdb_bfd_init_data(), gdb_bfd_unref(), and maintenance_info_bfds().
|
static |
Definition at line 1119 of file gdb_bfd.c.
Referenced by get_bfd_inferior_data().
|
static |
Definition at line 133 of file gdb_bfd.c.
Referenced by gdb_bfd_open().
|
static |
Definition at line 128 of file gdb_bfd.c.
Referenced by gdb_bfd_open(), and gdb_bfd_unref().