GDB (xrefs)
Classes | Functions | Variables
/tmp/gdb-8.1/gdb/objfiles.c File Reference
#include "defs.h"
#include "bfd.h"
#include "symtab.h"
#include "symfile.h"
#include "objfiles.h"
#include "gdb-stabs.h"
#include "target.h"
#include "bcache.h"
#include "expression.h"
#include "parser-defs.h"
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include "gdb_obstack.h"
#include "hashtab.h"
#include "breakpoint.h"
#include "block.h"
#include "dictionary.h"
#include "source.h"
#include "addrmap.h"
#include "arch-utils.h"
#include "exec.h"
#include "observer.h"
#include "complaints.h"
#include "psymtab.h"
#include "solist.h"
#include "gdb_bfd.h"
#include "btrace.h"
#include <vector>

Go to the source code of this file.

Classes

struct  objfile_pspace_info
 
struct  static_link_htab_entry
 

Functions

static void objfiles_pspace_data_cleanup (struct program_space *pspace, void *arg)
 
static struct objfile_pspace_infoget_objfile_pspace_data (struct program_space *pspace)
 
static struct objfile_per_bfd_storageget_objfile_bfd_data (struct objfile *objfile, struct bfd *abfd)
 
static void free_objfile_per_bfd_storage (struct objfile_per_bfd_storage *storage)
 
static void objfile_bfd_data_free (struct bfd *unused, void *d)
 
void set_objfile_per_bfd (struct objfile *objfile)
 
void set_objfile_main_name (struct objfile *objfile, const char *name, enum language lang)
 
static hashval_t static_link_htab_entry_hash (const void *p)
 
static int static_link_htab_entry_eq (const void *p1, const void *p2)
 
void objfile_register_static_link (struct objfile *objfile, const struct block *block, const struct dynamic_prop *static_link)
 
const struct dynamic_propobjfile_lookup_static_link (struct objfile *objfile, const struct block *block)
 
static void add_to_objfile_sections_full (struct bfd *abfd, struct bfd_section *asect, struct objfile *objfile, int force)
 
static void add_to_objfile_sections (struct bfd *abfd, struct bfd_section *asect, void *objfilep)
 
void build_objfile_section_table (struct objfile *objfile)
 
struct gdbarchget_objfile_arch (const struct objfile *objfile)
 
int entry_point_address_query (CORE_ADDR *entry_p)
 
CORE_ADDR entry_point_address (void)
 
struct objfileobjfile_separate_debug_iterate (const struct objfile *parent, const struct objfile *objfile)
 
void put_objfile_before (struct objfile *objfile, struct objfile *before_this)
 
void unlink_objfile (struct objfile *objfile)
 
void add_separate_debug_objfile (struct objfile *objfile, struct objfile *parent)
 
void free_objfile_separate_debug (struct objfile *objfile)
 
void free_all_objfiles (void)
 
static void relocate_one_symbol (struct symbol *sym, struct objfile *objfile, struct section_offsets *delta)
 
static int objfile_relocate1 (struct objfile *objfile, const struct section_offsets *new_offsets)
 
void objfile_relocate (struct objfile *objfile, const struct section_offsets *new_offsets)
 
static int objfile_rebase1 (struct objfile *objfile, CORE_ADDR slide)
 
void objfile_rebase (struct objfile *objfile, CORE_ADDR slide)
 
int objfile_has_partial_symbols (struct objfile *objfile)
 
int objfile_has_full_symbols (struct objfile *objfile)
 
int objfile_has_symbols (struct objfile *objfile)
 
int have_partial_symbols (void)
 
int have_full_symbols (void)
 
void objfile_purge_solibs (void)
 
int have_minimal_symbols (void)
 
static int qsort_cmp (const void *a, const void *b)
 
static struct obj_sectionpreferred_obj_section (struct obj_section *a, struct obj_section *b)
 
static int insert_section_p (const struct bfd *abfd, const struct bfd_section *section)
 
static int filter_debuginfo_sections (struct obj_section **map, int map_size)
 
static int filter_overlapping_sections (struct obj_section **map, int map_size)
 
static void update_section_map (struct program_space *pspace, struct obj_section ***pmap, int *pmap_size)
 
static int bsearch_cmp (const void *key, const void *elt)
 
struct obj_sectionfind_pc_section (CORE_ADDR pc)
 
int pc_in_section (CORE_ADDR pc, const char *name)
 
void objfiles_changed (void)
 
void inhibit_section_map_updates (struct program_space *pspace)
 
void resume_section_map_updates (struct program_space *pspace)
 
void resume_section_map_updates_cleanup (void *arg)
 
int is_addr_in_objfile (CORE_ADDR addr, const struct objfile *objfile)
 
int shared_objfile_contains_address_p (struct program_space *pspace, CORE_ADDR address)
 
void default_iterate_over_objfiles_in_search_order (struct gdbarch *gdbarch, iterate_over_objfiles_in_search_order_cb_ftype *cb, void *cb_data, struct objfile *current_objfile)
 
const char * objfile_name (const struct objfile *objfile)
 
const char * objfile_filename (const struct objfile *objfile)
 
const char * objfile_debug_name (const struct objfile *objfile)
 
const char * objfile_flavour_name (struct objfile *objfile)
 
void _initialize_objfiles (void)
 

Variables

static const struct program_space_data * objfiles_pspace_data
 
static const struct bfd_data * objfiles_bfd_data
 

Function Documentation

◆ _initialize_objfiles()

void _initialize_objfiles ( void  )

◆ add_separate_debug_objfile()

void add_separate_debug_objfile ( struct objfile objfile,
struct objfile parent 
)

◆ add_to_objfile_sections()

static void add_to_objfile_sections ( struct bfd *  abfd,
struct bfd_section *  asect,
void *  objfilep 
)
static

Definition at line 330 of file objfiles.c.

References add_to_objfile_sections_full().

Referenced by build_objfile_section_table().

◆ add_to_objfile_sections_full()

static void add_to_objfile_sections_full ( struct bfd *  abfd,
struct bfd_section *  asect,
struct objfile objfile,
int  force 
)
static

◆ bsearch_cmp()

static int bsearch_cmp ( const void *  key,
const void *  elt 
)
static

Definition at line 1380 of file objfiles.c.

References obj_section_addr, and obj_section_endaddr.

Referenced by find_pc_section().

◆ build_objfile_section_table()

void build_objfile_section_table ( struct objfile objfile)

◆ default_iterate_over_objfiles_in_search_order()

void default_iterate_over_objfiles_in_search_order ( struct gdbarch gdbarch,
iterate_over_objfiles_in_search_order_cb_ftype cb,
void *  cb_data,
struct objfile current_objfile 
)

Definition at line 1539 of file objfiles.c.

References ALL_OBJFILES, and objfile::objfile().

Referenced by gdbarch_alloc().

◆ entry_point_address()

CORE_ADDR entry_point_address ( void  )

◆ entry_point_address_query()

int entry_point_address_query ( CORE_ADDR entry_p)

Definition at line 454 of file objfiles.c.

References ANOFFSET, and symfile_objfile.

Referenced by enable_break(), entry_point_address(), and inside_entry_func().

◆ filter_debuginfo_sections()

static int filter_debuginfo_sections ( struct obj_section **  map,
int  map_size 
)
static

◆ filter_overlapping_sections()

static int filter_overlapping_sections ( struct obj_section **  map,
int  map_size 
)
static

◆ find_pc_section()

struct obj_section* find_pc_section ( CORE_ADDR  pc)

◆ free_all_objfiles()

void free_all_objfiles ( void  )

◆ free_objfile_per_bfd_storage()

static void free_objfile_per_bfd_storage ( struct objfile_per_bfd_storage storage)
static

◆ free_objfile_separate_debug()

void free_objfile_separate_debug ( struct objfile objfile)

◆ get_objfile_arch()

struct gdbarch* get_objfile_arch ( const struct objfile objfile)

Definition at line 445 of file objfiles.c.

References objfile_per_bfd_storage::gdbarch, and objfile::per_bfd.

Referenced by add_partial_subprogram(), add_partial_symbol(), basic_type(), block_gdbarch(), call_target_sbrk(), checkpoint_command(), coff_read_enum_type(), coff_symtab_read(), create_addrmap_from_aranges(), create_addrmap_from_index(), create_exception_master_breakpoint(), create_longjmp_master_breakpoint(), create_overlay_event_breakpoint(), create_std_terminate_master_breakpoint(), dbx_end_psymtab(), dbx_init_float_type(), decode_base_type(), decode_frame_entry_1(), define_symbol(), dtrace_process_dof(), dump_msymbols(), dump_psymtab(), dump_psymtab_addrmap_1(), dump_symtab_1(), dw2_find_pc_sect_compunit_symtab(), dwarf2_add_field(), dwarf2_evaluate_loc_desc_full(), dwarf2_find_location_expression(), dwarf2_init_float_type(), dwarf2_loc_desc_get_symbol_read_needs(), dwarf2_locexpr_baton_eval(), dwarf2_ranges_read(), dwarf2_record_block_ranges(), dwarf_decode_lines_1(), edit_command(), elf_gnu_ifunc_record_cache(), elf_gnu_ifunc_resolve_by_got(), elf_rel_plt_read(), elf_symtab_read(), enter_line_range(), enter_linenos(), filter_overlapping_sections(), finalize_symtab(), find_function_in_inferior(), find_minsym_type_and_address(), find_solib_trampoline_target(), finish_block_internal(), gdbpy_execute_objfile_script(), gdbpy_source_objfile_script(), get_sal_arch(), get_type_arch(), handle_stap_probe(), identify_source_line(), info_address_command(), info_line_command(), init_entry_point_info(), init_float_type(), insert_exception_resume_from_probe(), internalize_unwinds(), linux_infcall_mmap(), linux_infcall_munmap(), list_command(), list_overlays_command(), locexpr_describe_location_1(), locexpr_describe_location_piece(), loclist_describe_location(), lookup_global_symbol(), macho_add_oso_symfile(), maintenance_check_psymtabs(), maintenance_info_psymtabs(), mark_common_block_symbol_computed(), mi_cmd_symbol_list_lines(), minsym_found(), msymbol_is_function(), new_symbol_full(), objfile_type(), ocl_enable_break(), parse_partial_symbols(), parse_symbol(), print_msymbol_info(), process_full_comp_unit(), process_one_symbol(), process_psymtab_comp_unit_reader(), psym_find_pc_sect_compunit_symtab(), psymtab_to_symtab_1(), dwarf_evaluate_loc_desc::push_dwarf_reg_entry_value(), py_free_objfile(), python_new_objfile(), read_attribute_value(), read_base_type(), read_call_site_scope(), read_dbx_symtab(), read_debug_names_from_section(), read_enum_type(), read_file_scope(), read_func_scope(), read_lexical_block_scope(), read_one_struct_field(), read_partial_die(), read_range_type(), read_subrange_type(), read_tag_pointer_type(), read_tag_string_type(), record_minimal_symbol(), rw_pieced_value(), save_objfile_types(), scan_xcoff_symtab(), section_is_mapped(), simple_overlay_update_1(), simple_read_overlay_table(), skip_prologue_sal(), spu_catch_start(), symbol_arch(), tui_set_source_content(), tui_update_source_windows_with_line(), value_allocate_space_in_inferior(), value_fn_field(), and write_debug_names().

◆ get_objfile_bfd_data()

static struct objfile_per_bfd_storage* get_objfile_bfd_data ( struct objfile objfile,
struct bfd *  abfd 
)
static

◆ get_objfile_pspace_data()

static struct objfile_pspace_info* get_objfile_pspace_data ( struct program_space pspace)
static

◆ have_full_symbols()

int have_full_symbols ( void  )

◆ have_minimal_symbols()

int have_minimal_symbols ( void  )

◆ have_partial_symbols()

int have_partial_symbols ( void  )

◆ inhibit_section_map_updates()

void inhibit_section_map_updates ( struct program_space pspace)

◆ insert_section_p()

static int insert_section_p ( const struct bfd *  abfd,
const struct bfd_section *  section 
)
static

Definition at line 1196 of file objfiles.c.

References overlay_debugging.

Referenced by update_section_map().

◆ is_addr_in_objfile()

int is_addr_in_objfile ( CORE_ADDR  addr,
const struct objfile objfile 
)

◆ objfile_bfd_data_free()

static void objfile_bfd_data_free ( struct bfd *  unused,
void *  d 
)
static

Definition at line 187 of file objfiles.c.

References free_objfile_per_bfd_storage().

Referenced by _initialize_objfiles().

◆ objfile_debug_name()

const char* objfile_debug_name ( const struct objfile objfile)

◆ objfile_filename()

const char* objfile_filename ( const struct objfile objfile)

Definition at line 1568 of file objfiles.c.

References objfile::obfd.

Referenced by objfpy_lookup_objfile_by_name().

◆ objfile_flavour_name()

const char* objfile_flavour_name ( struct objfile objfile)

Definition at line 1587 of file objfiles.c.

References objfile::obfd.

Referenced by default_read_var_value().

◆ objfile_has_full_symbols()

int objfile_has_full_symbols ( struct objfile objfile)

Definition at line 998 of file objfiles.c.

References objfile::compunit_symtabs.

Referenced by have_full_symbols(), and objfile_has_symbols().

◆ objfile_has_partial_symbols()

int objfile_has_partial_symbols ( struct objfile objfile)

◆ objfile_has_symbols()

int objfile_has_symbols ( struct objfile objfile)

◆ objfile_lookup_static_link()

const struct dynamic_prop* objfile_lookup_static_link ( struct objfile objfile,
const struct block block 
)

◆ objfile_name()

const char* objfile_name ( const struct objfile objfile)

Definition at line 1557 of file objfiles.c.

References objfile::obfd, and objfile::original_name.

Referenced by allocate_psymtab(), allocate_symtab(), auto_load_objfile_script(), auto_load_objfile_script_1(), build_error_marker_type(), lnp_state_machine::check_line_address(), clone_program_space(), coff_symtab_read(), collect_probes(), compare_probes(), compile_object_load(), compile_object_run(), create_addrmap_from_aranges(), create_dwp_v2_section(), dbx_symfile_read(), die_containing_type(), do_module_cleanup(), dump_msymbols(), dump_objfile(), dump_psymtab(), dump_symtab_1(), dw2_expand_marked_cus(), dw2_symtab_iter_next(), dwarf2_build_frame_info(), dwarf2_build_psymtabs_hard(), dwarf2_fetch_constant_bytes(), dwarf2_fetch_die_loc_sect_off(), dwarf2_get_dwz_file(), dwarf2_physname(), dwarf2_ranges_process(), dwarf2_read_debug_names(), dwarf2_read_index(), dwarf2_rnglists_process(), dwarf2_string_attr(), elf_read_minimal_symbols(), execute_script_contents(), filter_overlapping_sections(), find_separate_debug_file(), find_separate_debug_file_by_buildid(), find_separate_debug_file_by_debuglink(), find_separate_debug_file_in_section(), dw2_debug_names_iterator::find_vec_in_debug_names(), fixup_go_packaging(), follow_die_ref(), follow_die_ref_or_sig(), follow_die_sig(), gdbscm_objfile_filename(), gdbscm_progspace_filename(), get_DW_AT_signature_type(), get_out_value_type(), get_regs_type(), get_signatured_type(), handle_stap_probe(), has_libpthread(), info_address_command(), info_probes_for_spops(), info_symbol_command(), info_target_command(), minimal_symbol_reader::install(), is_known_support_routine(), load_partial_dies(), locexpr_describe_location_piece(), lookup_die_type(), lookup_dwo_cutu(), lookup_dwo_unit(), macho_check_dsym(), macho_symfile_relocate(), macho_symtab_read(), maintenance_check_symtabs(), maintenance_info_psymtabs(), maintenance_info_symtabs(), maintenance_print_msymbols(), maintenance_print_objfiles(), maintenance_print_one_line_table(), maintenance_print_psymbols(), maintenance_print_symbol_cache(), maintenance_print_symbol_cache_statistics(), maintenance_print_symbols(), maintenance_translate_address(), maybe_print_script_not_found_warning(), maybe_print_unsupported_script_warning(), dw2_debug_names_iterator::next(), objfpy_get_filename(), ofscm_print_objfile_smob(), open_and_init_dwp_file(), parse_probes_in_pspace(), print_objfile_statistics(), print_symbol_bcache_statistics(), process_imported_unit_die(), process_queue(), pspy_get_filename(), psscm_print_pspace_smob(), read_addr_index_1(), read_array_type(), read_call_site_scope(), read_common_block(), read_import_statement(), read_one_sym(), read_partial_die(), read_str_index(), read_subrange_type(), read_typedef(), remove_symbol_file_command(), require_partial_symbols(), reread_symbols(), save_gdb_index_command(), scan_file_globals(), scan_partial_symbols(), separate_debug_file_exists(), solib_aix_get_toc_value(), solib_read_symbols(), source_script_file(), symbol_file_clear(), target_translate_tls_address(), thread_db_new_objfile(), try_thread_db_load_from_pdir(), try_thread_db_load_from_pdir_1(), type_name_no_tag_or_error(), write_psymtabs_to_index(), and xcoff_initial_scan().

◆ objfile_purge_solibs()

void objfile_purge_solibs ( void  )

Definition at line 1058 of file objfiles.c.

References ALL_OBJFILES_SAFE, objfile::flags, OBJF_SHARED, and OBJF_USERLOADED.

Referenced by no_shared_libraries().

◆ objfile_rebase()

void objfile_rebase ( struct objfile objfile,
CORE_ADDR  slide 
)

◆ objfile_rebase1()

static int objfile_rebase1 ( struct objfile objfile,
CORE_ADDR  slide 
)
static

◆ objfile_register_static_link()

void objfile_register_static_link ( struct objfile objfile,
const struct block block,
const struct dynamic_prop static_link 
)

◆ objfile_relocate()

void objfile_relocate ( struct objfile objfile,
const struct section_offsets new_offsets 
)

◆ objfile_relocate1()

static int objfile_relocate1 ( struct objfile objfile,
const struct section_offsets new_offsets 
)
static

◆ objfile_separate_debug_iterate()

struct objfile* objfile_separate_debug_iterate ( const struct objfile parent,
const struct objfile objfile 
)

◆ objfiles_changed()

void objfiles_changed ( void  )

◆ objfiles_pspace_data_cleanup()

static void objfiles_pspace_data_cleanup ( struct program_space pspace,
void *  arg 
)
static

Definition at line 86 of file objfiles.c.

References objfile_pspace_info::sections, and xfree().

Referenced by _initialize_objfiles().

◆ pc_in_section()

int pc_in_section ( CORE_ADDR  pc,
const char *  name 
)

Definition at line 1442 of file objfiles.c.

References find_pc_section(), name, and obj_section::the_bfd_section.

Referenced by in_mips_stubs_section(), and in_plt_section().

◆ preferred_obj_section()

static struct obj_section* preferred_obj_section ( struct obj_section a,
struct obj_section b 
)
static

◆ put_objfile_before()

void put_objfile_before ( struct objfile objfile,
struct objfile before_this 
)

◆ qsort_cmp()

static int qsort_cmp ( const void *  a,
const void *  b 
)
static

◆ relocate_one_symbol()

static void relocate_one_symbol ( struct symbol sym,
struct objfile objfile,
struct section_offsets delta 
)
static

◆ resume_section_map_updates()

void resume_section_map_updates ( struct program_space pspace)

◆ resume_section_map_updates_cleanup()

void resume_section_map_updates_cleanup ( void *  arg)

Definition at line 1485 of file objfiles.c.

References resume_section_map_updates().

Referenced by svr4_handle_solib_event().

◆ set_objfile_main_name()

void set_objfile_main_name ( struct objfile objfile,
const char *  name,
enum language  lang 
)

◆ set_objfile_per_bfd()

void set_objfile_per_bfd ( struct objfile objfile)

Definition at line 195 of file objfiles.c.

References get_objfile_bfd_data(), objfile::obfd, and objfile::per_bfd.

Referenced by reread_symbols().

◆ shared_objfile_contains_address_p()

int shared_objfile_contains_address_p ( struct program_space pspace,
CORE_ADDR  address 
)

◆ static_link_htab_entry_eq()

static int static_link_htab_entry_eq ( const void *  p1,
const void *  p2 
)
static

Definition at line 238 of file objfiles.c.

References static_link_htab_entry::block.

Referenced by objfile_register_static_link().

◆ static_link_htab_entry_hash()

static hashval_t static_link_htab_entry_hash ( const void *  p)
static

Definition at line 226 of file objfiles.c.

References static_link_htab_entry::block.

Referenced by objfile_register_static_link().

◆ unlink_objfile()

void unlink_objfile ( struct objfile objfile)

Definition at line 557 of file objfiles.c.

References _, internal_error(), objfile::next, and object_files.

Referenced by put_objfile_before(), and objfile::~objfile().

◆ update_section_map()

static void update_section_map ( struct program_space pspace,
struct obj_section ***  pmap,
int *  pmap_size 
)
static

Variable Documentation

◆ objfiles_bfd_data

const struct bfd_data* objfiles_bfd_data
static

Definition at line 117 of file objfiles.c.

Referenced by _initialize_objfiles(), and get_objfile_bfd_data().

◆ objfiles_pspace_data

const struct program_space_data* objfiles_pspace_data
static

Definition at line 83 of file objfiles.c.

Referenced by _initialize_objfiles(), and get_objfile_pspace_data().