36 #include <sys/types.h>
100 info = program_space_data (pspace, objfiles_pspace_data);
104 set_program_space_data (pspace, objfiles_pspace_data, info);
130 storage = bfd_data (abfd, objfiles_bfd_data);
140 set_bfd_data (abfd, objfiles_bfd_data, storage);
219 aflag = bfd_get_section_flags (abfd, asect);
220 if (!(aflag & SEC_ALLOC))
251 bfd_map_over_sections (objfile->
obfd,
290 objfile = (
struct objfile *)
xzalloc (
sizeof (
struct objfile));
296 objfile_alloc_data (objfile);
302 expanded_name = xstrdup (
"<<anonymous objfile>>");
306 expanded_name = xstrdup (name);
311 strlen (expanded_name));
312 xfree (expanded_name);
318 objfile->
obfd = abfd;
322 objfile->
mtime = bfd_get_mtime (abfd);
343 objfile->
next = NULL;
348 struct objfile *last_one;
352 last_one = last_one->
next);
353 last_one->
next = objfile;
397 error (
_(
"Entry point address is not known."));
422 if (objfile == parent)
448 struct objfile **objp;
452 for (objp = &
object_files; *objp != NULL; objp = &((*objp)->next))
454 if (*objp == before_this)
456 objfile->
next = *objp;
463 _(
"put_objfile_before: before objfile not in list"));
482 struct objfile **objpp;
484 for (objpp = &
object_files; *objpp != NULL; objpp = &((*objpp)->next))
486 if (*objpp == objfile)
488 *objpp = (*objpp)->
next;
489 objfile->
next = NULL;
495 _(
"unlink_objfile: objfile already unlinked"));
527 struct objfile *child;
552 struct objfile *child;
556 if (child == objfile)
597 if (objfile->
sf != NULL)
604 objfile_free_data (objfile);
726 int something_changed = 0;
733 something_changed = 1;
735 if (!something_changed)
752 for (i = 0; i < l->
nitems; ++i)
766 ANOFFSET (delta, block_line_section));
801 objfile->
sf->
qf->
relocate (objfile, new_offsets, delta);
839 struct objfile *debug_objfile;
892 new_offsets->
offsets[i] = slide;
903 struct objfile *debug_objfile;
1045 if (sect1_addr < sect2_addr)
1047 else if (sect1_addr > sect2_addr)
1076 if (objfile1 == objfile2)
1086 else if (osect == sect2)
1099 if (objfile == objfile1)
1101 else if (objfile == objfile2)
1139 const struct bfd_section *section)
1141 const bfd_vma lma = bfd_section_lma (abfd, section);
1144 && (bfd_get_file_flags (abfd) & BFD_IN_MEMORY) == 0)
1149 if ((bfd_get_section_flags (abfd, section) & SEC_THREAD_LOCAL) != 0)
1165 for (i = 0, j = 0; i < map_size - 1; i++)
1174 if (sect1_addr == sect2_addr
1207 for (i = 0, j = 0; i < map_size - 1; )
1212 for (k = i + 1; k < map_size; k++)
1222 if (sect1_endaddr <= sect2_addr)
1239 _(
"unexpected overlap between:\n"
1240 " (A) section `%s' from `%s' [%s, %s)\n"
1241 " (B) section `%s' from `%s' [%s, %s).\n"
1242 "Will ignore section B"),
1248 paddress (gdbarch, sect2_endaddr));
1272 int alloc_size, map_size, i;
1290 if (alloc_size == 0)
1297 map =
xmalloc (alloc_size *
sizeof (*map));
1309 if (map_size < alloc_size)
1311 map =
xrealloc (map, map_size *
sizeof (*map));
1316 *pmap_size = map_size;
1440 if (objfile == NULL)
1481 (
struct gdbarch *gdbarch,
1483 void *cb_data,
struct objfile *current_objfile)
1490 stop = cb (objfile, cb_data);
1501 if (objfile->
obfd != NULL)
1502 return bfd_get_filename (objfile->
obfd);
1512 if (objfile->
obfd != NULL)
1513 return bfd_get_filename (objfile->
obfd);
1532 objfiles_pspace_data
1533 = register_program_space_data_with_cleanup (NULL,
1536 objfiles_bfd_data = register_bfd_data_with_cleanup (NULL,
void objfiles_changed(void)
struct psymbol_allocation_list static_psymbols
void resume_section_map_updates(struct program_space *pspace)
void addr_info_make_relative(struct section_addr_info *addrs, bfd *abfd)
static void do_free_objfile_cleanup(void *obj)
struct htab * demangled_names_hash
#define OBSTACK_CALLOC(OBSTACK, NUMBER, TYPE)
#define SECT_OFF_TEXT(objfile)
#define ALL_OBJFILE_FILETABS(objfile, cu, s)
char * gdb_abspath(const char *path)
struct psymbol_bcache * psymbol_bcache_init(void)
struct obstack storage_obstack
#define DEFINE_REGISTRY(TAG, ACCESS)
struct linetable_entry item[1]
void psymbol_bcache_free(struct psymbol_bcache *bcache)
int gdb_bfd_section_index(bfd *abfd, asection *section)
void free_all_objfiles(void)
struct objfile * separate_debug_objfile_backlink
int section_is_overlay(struct obj_section *section)
struct symbol * hash_next
struct bfd_section * the_bfd_section
void relative_addr_info_to_section_offsets(struct section_offsets *section_offsets, int num_sections, const struct section_addr_info *addrs)
struct psymbol_allocation_list global_psymbols
int objfile_has_symbols(struct objfile *objfile)
struct program_space * pspace
int gdb_bfd_requires_relocations(bfd *abfd)
struct symtab_and_line get_current_source_symtab_and_line(void)
#define SYMBOL_CLASS(symbol)
void internal_error(const char *file, int line, const char *fmt,...)
#define obj_section_endaddr(s)
const char * objfile_filename(const struct objfile *objfile)
#define REGISTRY_ACCESS_FIELD(CONTAINER)
void objfile_relocate(struct objfile *objfile, const struct section_offsets *new_offsets)
struct section_addr_info * build_section_addr_info_from_objfile(const struct objfile *objfile)
#define ALL_DICT_SYMBOLS(dict, iter, sym)
void set_objfile_main_name(struct objfile *objfile, const char *name, enum language lang)
const struct block * innermost_block
int have_partial_symbols(void)
#define ALL_OBJFILE_OSECTIONS(objfile, osect)
#define BLOCKVECTOR_BLOCK(blocklist, n)
#define OBJF_NOT_FILENAME
void inhibit_section_map_updates(struct program_space *pspace)
struct objfile_per_bfd_storage * per_bfd
struct symbol * template_symbols
int is_addr_in_objfile(CORE_ADDR addr, const struct objfile *objfile)
static int objfile_rebase1(struct objfile *objfile, CORE_ADDR slide)
void set_objfile_per_bfd(struct objfile *objfile)
const char * paddress(struct gdbarch *gdbarch, CORE_ADDR addr)
void breakpoint_free_objfile(struct objfile *objfile)
#define obj_section_addr(s)
void gdb_bfd_ref(struct bfd *abfd)
struct obstack objfile_obstack
void observer_notify_free_objfile(struct objfile *objfile)
mach_port_t kern_return_t mach_port_t msgports mach_port_t kern_return_t pid_t pid mach_port_t kern_return_t mach_port_t task mach_port_t kern_return_t int flags
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)
#define SIZEOF_N_SECTION_OFFSETS(n)
int( iterate_over_objfiles_in_search_order_cb_ftype)(struct objfile *objfile, void *cb_data)
struct so_list * master_so_list(void)
int objfile_has_partial_symbols(struct objfile *objfile)
#define ALL_OBJFILES(obj)
int shared_objfile_contains_address_p(struct program_space *pspace, CORE_ADDR address)
static void update_section_map(struct program_space *pspace, struct obj_section ***pmap, int *pmap_size)
void breakpoint_re_set(void)
#define SYMBOL_VALUE_ADDRESS(symbol)
void free_objfile_separate_debug(struct objfile *objfile)
void free_objfile(struct objfile *objfile)
struct cleanup * make_cleanup_free_objfile(struct objfile *obj)
void clear_current_source_symtab_and_line(void)
void gdb_bfd_unref(struct bfd *abfd)
void initialize_file_ftype(void)
int objfile_has_full_symbols(struct objfile *objfile)
void * xzalloc(size_t size)
#define SYMTAB_OBJFILE(symtab)
static const struct program_space_data * objfiles_pspace_data
static void objfiles_pspace_data_cleanup(struct program_space *pspace, void *arg)
struct obj_section ** sections
void preserve_values(struct objfile *objfile)
void add_separate_debug_objfile(struct objfile *objfile, struct objfile *parent)
#define gdb_assert_not_reached(message)
const struct sym_fns * sf
void build_objfile_section_table(struct objfile *objfile)
void complaint(struct complaints **complaints, const char *fmt,...)
struct cleanup * make_cleanup(make_cleanup_ftype *function, void *arg)
#define ANOFFSET(secoff, whichone)
struct gdbarch * get_objfile_arch(const struct objfile *objfile)
struct obj_section * sections
static int filter_overlapping_sections(struct obj_section **map, int map_size)
struct bcache * bcache_xmalloc(unsigned long(*hash_function)(const void *, int length), int(*compare_function)(const void *, const void *, int length))
void forget_cached_source_info_for_objfile(struct objfile *objfile)
struct objfile * separate_debug_objfile
static int objfile_relocate1(struct objfile *objfile, const struct section_offsets *new_offsets)
struct compunit_symtab * compunit_symtabs
static int qsort_cmp(const void *a, const void *b)
static void add_to_objfile_sections(struct bfd *abfd, struct bfd_section *asect, void *objfilep)
int section_is_mapped(struct obj_section *osect)
static void relocate_one_symbol(struct symbol *sym, struct objfile *objfile, struct section_offsets *delta)
void(* sym_finish)(struct objfile *)
struct obj_section * find_pc_section(CORE_ADDR pc)
const char * objfile_name(const struct objfile *objfile)
void(* relocate)(struct objfile *objfile, const struct section_offsets *new_offsets, const struct section_offsets *delta)
initialize_file_ftype _initialize_objfiles
void(* sym_read_psymbols)(struct objfile *)
#define ALL_OBJFILE_COMPUNITS(objfile, cu)
struct bcache * macro_cache
struct objfile * separate_debug_objfile_link
void exec_set_section_address(const char *filename, int index, CORE_ADDR address)
struct bcache * filename_cache
void clear_pc_function_cache(void)
PTR xrealloc(PTR ptr, size_t size)
int have_minimal_symbols(void)
void objfile_purge_solibs(void)
void clear_symtab_users(int add_flags)
#define OBJF_PSYMTABS_READ
#define COMPUNIT_BLOCKVECTOR(cust)
struct symbol * fixup_symbol_section(struct symbol *sym, struct objfile *objfile)
int entry_point_address_query(CORE_ADDR *entry_p)
void unlink_objfile(struct objfile *objfile)
struct gdbarch * gdbarch_from_bfd(bfd *abfd)
CORE_ADDR entry_point_address(void)
struct obj_section * find_pc_mapped_section(CORE_ADDR pc)
const char * name_of_main
void btrace_free_objfile(struct objfile *objfile)
static struct objfile_pspace_info * get_objfile_pspace_data(struct program_space *pspace)
struct obj_section * sections_end
struct complaints * symfile_complaints
int gdb_bfd_count_sections(bfd *abfd)
#define COMPUNIT_BLOCK_LINE_SECTION(cust)
struct objfile * objfile_separate_debug_iterate(const struct objfile *parent, const struct objfile *objfile)
const char * objfile_debug_name(const struct objfile *objfile)
enum language language_of_main
static int bsearch_cmp(const void *key, const void *elt)
#define ALL_OBJFILES_SAFE(obj, nxt)
int pc_in_section(CORE_ADDR pc, char *name)
#define BLOCKVECTOR_NBLOCKS(blocklist)
int have_full_symbols(void)
struct objfile * allocate_objfile(bfd *abfd, const char *name, int flags)
static void free_objfile_per_bfd_storage(struct objfile_per_bfd_storage *storage)
void bcache_xfree(struct bcache *bcache)
void addrmap_relocate(struct addrmap *map, CORE_ADDR offset)
static const struct bfd_data * objfiles_bfd_data
struct partial_symbol ** list
const struct block * expression_context_block
enum overlay_debugging_state overlay_debugging
struct program_space * current_program_space
struct addrmap * psymtabs_addrmap
static struct obj_section * preferred_obj_section(struct obj_section *a, struct obj_section *b)
#define BLOCKVECTOR_MAP(blocklist)
#define OBSTACK_ZALLOC(OBSTACK, TYPE)
#define SYMBOL_SECTION(symbol)
int new_objfiles_available
struct section_offsets * section_offsets
void terminate_minimal_symbol_table(struct objfile *objfile)
static int insert_section_p(const struct bfd *abfd, const struct bfd_section *section)
const struct quick_symbol_functions * qf
void put_objfile_before(struct objfile *objfile, struct objfile *before_this)
static int filter_debuginfo_sections(struct obj_section **map, int map_size)
static void add_to_objfile_sections_full(struct bfd *abfd, struct bfd_section *asect, struct objfile *objfile, int force)
int(* has_symbols)(struct objfile *objfile)
#define ALL_PSPACE_OBJFILES(ss, obj)
int is_target_filename(const char *name)
void resume_section_map_updates_cleanup(void *arg)
#define SYMTAB_LINETABLE(symtab)
struct psymbol_bcache * psymbol_cache
static struct objfile_per_bfd_storage * get_objfile_bfd_data(struct objfile *objfile, struct bfd *abfd)
void error(const char *fmt,...)
void objfile_rebase(struct objfile *objfile, CORE_ADDR slide)
void do_cleanups(struct cleanup *old_chain)
static void objfile_bfd_data_free(struct bfd *unused, void *d)