GDB (xrefs)
Classes | Functions | Variables
/home/stan/gdb/src/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 "gdb_assert.h"
#include <sys/types.h>
#include "gdb_stat.h"
#include <fcntl.h>
#include "gdb_obstack.h"
#include "gdb_string.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"

Go to the source code of this file.

Classes

struct  objfile_pspace_info

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_storage
get_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)
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 objfileallocate_objfile (bfd *abfd, const char *name, int flags)
struct gdbarchget_objfile_arch (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 objfile_to_front (struct objfile *objfile)
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_objfile (struct objfile *objfile)
static void do_free_objfile_cleanup (void *obj)
struct cleanupmake_cleanup_free_objfile (struct objfile *obj)
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, 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)
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)
void _initialize_objfiles (void)

Variables

static struct program_space_data * objfiles_pspace_data
static struct bfd_data * objfiles_bfd_data
initialize_file_ftype _initialize_objfiles

Function Documentation

void _initialize_objfiles ( void  )
void add_separate_debug_objfile ( struct objfile objfile,
struct objfile parent 
)
static void add_to_objfile_sections ( struct bfd *  abfd,
struct bfd_section *  asect,
void *  objfilep 
) [static]

Definition at line 222 of file objfiles.c.

References add_to_objfile_sections_full().

Referenced by build_objfile_section_table().

static void add_to_objfile_sections_full ( struct bfd *  abfd,
struct bfd_section *  asect,
struct objfile objfile,
int  force 
) [static]
struct objfile* allocate_objfile ( bfd *  abfd,
const char *  name,
int  flags 
) [read]
static int bsearch_cmp ( const void *  key,
const void *  elt 
) [static]

Definition at line 1361 of file objfiles.c.

References obj_section_addr, and obj_section_endaddr.

Referenced by find_pc_section().

void build_objfile_section_table ( struct objfile objfile)
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 1481 of file objfiles.c.

References ALL_OBJFILES.

Referenced by gdbarch_alloc().

static void do_free_objfile_cleanup ( void *  obj) [static]

Definition at line 671 of file objfiles.c.

References free_objfile().

Referenced by make_cleanup_free_objfile().

Definition at line 358 of file objfiles.c.

References symfile_objfile.

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

static int filter_debuginfo_sections ( struct obj_section **  map,
int  map_size 
) [static]
static int filter_overlapping_sections ( struct obj_section **  map,
int  map_size 
) [static]
struct obj_section* find_pc_section ( CORE_ADDR  pc) [read]
void free_all_objfiles ( void  )
void free_objfile ( struct objfile objfile)
static void free_objfile_per_bfd_storage ( struct objfile_per_bfd_storage storage) [static]
void free_objfile_separate_debug ( struct objfile objfile)
struct gdbarch* get_objfile_arch ( struct objfile objfile) [read]

Definition at line 349 of file objfiles.c.

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

Referenced by add_class_symtab_symbol(), add_minsym(), address_info(), basic_type(), call_target_sbrk(), checkpoint_command(), coff_read_enum_type(), coff_symtab_read(), cp_lookup_symbol_imports_or_template(), create_exception_master_breakpoint(), create_longjmp_master_breakpoint(), create_overlay_event_breakpoint(), create_std_terminate_master_breakpoint(), decode_base_type(), decode_frame_entry_1(), default_read_var_value(), define_symbol(), dump_msymbols(), dump_psymtab(), dump_symtab_1(), dw2_find_pc_sect_symtab(), dwarf2_add_field(), dwarf2_evaluate_loc_desc_full(), dwarf2_find_location_expression(), dwarf2_loc_desc_needs_frame(), dwarf_decode_lines_1(), dwarf_expr_push_dwarf_reg_entry_value(), edit_command(), elf_gnu_ifunc_record_cache(), elf_gnu_ifunc_resolve_by_got(), elf_rel_plt_read(), elf_symtab_read(), end_psymtab(), enter_line_range(), enter_linenos(), filter_overlapping_sections(), finalize_symtab(), find_function_in_inferior(), find_pc_sect_symtab_from_partial(), find_solib_trampoline_target(), finish_block_internal(), get_sal_arch(), get_type_arch(), handle_stap_probe(), ia64_hpux_solib_add_after_attach(), identify_source_line(), info_probes_for_ops(), init_entry_point_info(), insert_exception_resume_from_probe(), internalize_unwinds(), line_info(), list_command(), list_overlays_command(), locexpr_describe_location_1(), locexpr_describe_location_piece(), loclist_describe_location(), lookup_symbol_global(), macho_add_oso_symfile(), maintenance_check_psymtabs(), maintenance_info_psymtabs(), mark_common_block_symbol_computed(), mi_cmd_symbol_list_lines(), minsym_found(), objfile_type(), ocl_enable_break(), parse_partial_symbols(), parse_symbol(), print_msymbol_info(), process_one_symbol(), process_psymtab_comp_unit_reader(), psymtab_to_symtab_1(), py_free_objfile(), python_new_objfile(), read_call_site_scope(), read_dbx_symtab(), read_enum_type(), read_one_struct_field(), read_partial_die(), read_range_type(), read_subrange_type(), read_tag_pointer_type(), read_tag_string_type(), record_minimal_symbol(), save_objfile_types(), scan_xcoff_symtab(), scope_info(), section_is_mapped(), simple_overlay_update_1(), simple_read_overlay_table(), skip_prologue_sal(), som_symtab_read(), spu_catch_start(), stap_can_evaluate_probe_arguments(), stap_gen_info_probes_table_values(), stap_parse_probe_arguments(), tui_set_source_content(), tui_update_source_windows_with_line(), value_allocate_space_in_inferior(), value_fn_field(), and write_exp_msymbol().

static struct objfile_per_bfd_storage* get_objfile_bfd_data ( struct objfile objfile,
struct bfd *  abfd 
) [static, read]
static struct objfile_pspace_info* get_objfile_pspace_data ( struct program_space pspace) [static, read]
int have_full_symbols ( void  )

Definition at line 1060 of file objfiles.c.

References ALL_OBJFILES, and objfile::minimal_symbol_count.

Referenced by start_command(), and symbol_not_found_error().

void inhibit_section_map_updates ( struct program_space pspace)
static int insert_section_p ( const struct bfd *  abfd,
const struct bfd_section *  section 
) [static]

Definition at line 1177 of file objfiles.c.

References overlay_debugging.

Referenced by update_section_map().

struct cleanup* make_cleanup_free_objfile ( struct objfile obj) [read]

Definition at line 677 of file objfiles.c.

References do_free_objfile_cleanup(), and make_cleanup().

Referenced by reread_symbols(), and syms_from_objfile_1().

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

Definition at line 180 of file objfiles.c.

References free_objfile_per_bfd_storage().

Referenced by _initialize_objfiles().

int objfile_has_full_symbols ( struct objfile objfile)

Definition at line 979 of file objfiles.c.

References objfile::symtabs.

Referenced by have_full_symbols(), and objfile_has_symbols().

int objfile_has_partial_symbols ( struct objfile objfile)
int objfile_has_symbols ( struct objfile objfile)
const char* objfile_name ( const struct objfile objfile)

Definition at line 1499 of file objfiles.c.

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

Referenced by address_info(), allocate_psymtab(), allocate_symtab(), auto_load_objfile_script(), build_error_marker_type(), clone_program_space(), coff_symtab_read(), compare_probes(), create_dwo_cu(), create_dwp_v2_section(), dbx_symfile_read(), die_containing_type(), dump_msymbols(), dump_objfile(), dump_psymtab(), dump_subexp_body_standard(), dump_symtab_1(), dw2_expand_symtabs_matching(), 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_read(), dwarf2_read_index(), dwarf2_record_block_ranges(), dwarf_decode_lines_1(), elf_symfile_read(), filter_overlapping_sections(), find_separate_debug_file_by_buildid(), find_separate_debug_file_by_debuglink(), find_separate_debug_file_in_section(), fixup_go_packaging(), follow_die_ref(), follow_die_ref_or_sig(), follow_die_sig(), get_DW_AT_signature_type(), get_signatured_type(), handle_stap_probe(), has_libpthread(), info_probes_for_ops(), install_minimal_symbols(), is_known_support_routine(), load_partial_dies(), locexpr_describe_location_piece(), lookup_die_type(), lookup_dwo_cutu(), lookup_dwo_unit(), lookup_dwp_signatured_type(), 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_translate_address(), match_main(), objfpy_get_filename(), open_and_init_dwp_file(), parse_probes(), print_objfile_statistics(), print_symbol_bcache_statistics(), process_imported_unit_die(), process_queue(), pspy_get_filename(), read_addr_index_1(), read_call_site_scope(), read_common_block(), read_import_statement(), read_one_sym(), read_partial_die(), read_str_index(), read_subrange_type(), read_typedef(), 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(), som_solib_section_offsets(), source_gdb_script_for_objfile(), sym_info(), symbol_file_clear(), target_info(), 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().

void objfile_purge_solibs ( void  )

Definition at line 1039 of file objfiles.c.

References ALL_OBJFILES_SAFE, objfile::flags, free_objfile(), OBJF_SHARED, and OBJF_USERLOADED.

Referenced by no_shared_libraries().

void objfile_rebase ( struct objfile objfile,
CORE_ADDR  slide 
)
static int objfile_rebase1 ( struct objfile objfile,
CORE_ADDR  slide 
) [static]
void objfile_relocate ( struct objfile objfile,
const struct section_offsets new_offsets 
)
static int objfile_relocate1 ( struct objfile objfile,
const struct section_offsets new_offsets 
) [static]
struct objfile* objfile_separate_debug_iterate ( const struct objfile parent,
const struct objfile objfile 
) [read]
void objfile_to_front ( struct objfile objfile)

Definition at line 448 of file objfiles.c.

References objfile::next, and object_files.

void objfiles_changed ( void  )
static void objfiles_pspace_data_cleanup ( struct program_space pspace,
void *  arg 
) [static]

Definition at line 86 of file objfiles.c.

References objfiles_pspace_data, objfile_pspace_info::sections, and xfree().

Referenced by _initialize_objfiles().

int pc_in_section ( CORE_ADDR  pc,
char *  name 
)
static struct obj_section* preferred_obj_section ( struct obj_section a,
struct obj_section b 
) [static, read]
void put_objfile_before ( struct objfile objfile,
struct objfile before_this 
)

Definition at line 425 of file objfiles.c.

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

Referenced by add_separate_debug_objfile().

static int qsort_cmp ( const void *  a,
const void *  b 
) [static]
static void relocate_one_symbol ( struct symbol sym,
struct objfile objfile,
struct section_offsets delta 
) [static]
void resume_section_map_updates ( struct program_space pspace)
void resume_section_map_updates_cleanup ( void *  arg)

Definition at line 1466 of file objfiles.c.

References resume_section_map_updates().

Referenced by svr4_handle_solib_event().

void set_objfile_per_bfd ( struct objfile objfile)

Definition at line 188 of file objfiles.c.

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

Referenced by reread_symbols().

void unlink_objfile ( struct objfile objfile)

Definition at line 479 of file objfiles.c.

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

Referenced by free_objfile(), and put_objfile_before().

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

Variable Documentation

Referenced by initialize_all_files().

struct bfd_data* objfiles_bfd_data [static]

Definition at line 120 of file objfiles.c.

Referenced by _initialize_objfiles(), and get_objfile_bfd_data().

struct program_space_data* objfiles_pspace_data [static]
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Defines