static const struct target_so_ops *
solib_ops (struct gdbarch *gdbarch)
{
- const struct target_so_ops **ops = gdbarch_data (gdbarch, solib_data);
+ const struct target_so_ops **ops
+ = (const struct target_so_ops **) gdbarch_data (gdbarch, solib_data);
return *ops;
}
void
set_solib_ops (struct gdbarch *gdbarch, const struct target_so_ops *new_ops)
{
- const struct target_so_ops **ops = gdbarch_data (gdbarch, solib_data);
+ const struct target_so_ops **ops
+ = (const struct target_so_ops **) gdbarch_data (gdbarch, solib_data);
*ops = new_ops;
}
char *p;
/* Avoid clobbering our input. */
- p = alloca (strlen (in_pathname) + 1);
+ p = (char *) alloca (strlen (in_pathname) + 1);
strcpy (p, in_pathname);
in_pathname = p;
{
char *new_pathname;
- new_pathname = alloca (strlen (in_pathname) + 5);
+ new_pathname = (char *) alloca (strlen (in_pathname) + 5);
strcpy (new_pathname, in_pathname);
strcat (new_pathname, ".exe");
{
char *new_pathname;
- new_pathname = alloca (p - in_pathname + 1
- + strlen (solib_symbols_extension) + 1);
+ new_pathname
+ = (char *) alloca (p - in_pathname + 1
+ + strlen (solib_symbols_extension) + 1);
memcpy (new_pathname, in_pathname, p - in_pathname + 1);
strcpy (new_pathname + (p - in_pathname) + 1,
solib_symbols_extension);
&& so->objfile->addr_low == so->addr_low)
break;
}
- if (so->objfile != NULL)
- break;
-
- sap = build_section_addr_info_from_section_table (so->sections,
- so->sections_end);
- so->objfile = symbol_file_add_from_bfd (so->abfd, so->so_name,
- flags, sap, OBJF_SHARED,
- NULL);
- so->objfile->addr_low = so->addr_low;
- free_section_addr_info (sap);
+ if (so->objfile == NULL)
+ {
+ sap = build_section_addr_info_from_section_table (so->sections,
+ so->sections_end);
+ so->objfile = symbol_file_add_from_bfd (so->abfd, so->so_name,
+ flags, sap, OBJF_SHARED,
+ NULL);
+ so->objfile->addr_low = so->addr_low;
+ free_section_addr_info (sap);
+ }
so->symbols_loaded = 1;
}
/* Handler for library-specific lookup of global symbol NAME in OBJFILE. Call
the library-specific handler if it is installed for the current target. */
-struct symbol *
+struct block_symbol
solib_global_lookup (struct objfile *objfile,
const char *name,
const domain_enum domain)
{
- const struct target_so_ops *ops = solib_ops (get_objfile_arch (objfile));
+ const struct target_so_ops *ops = solib_ops (target_gdbarch ());
if (ops->lookup_lib_global_symbol != NULL)
return ops->lookup_lib_global_symbol (objfile, name, domain);
- return NULL;
+ return (struct block_symbol) {NULL, NULL};
}
/* Lookup the value for a specific symbol from dynamic symbol table. Look
CORE_ADDR
gdb_bfd_lookup_symbol_from_symtab (bfd *abfd,
- int (*match_sym) (asymbol *, void *),
- void *data)
+ int (*match_sym) (const asymbol *,
+ const void *),
+ const void *data)
{
long storage_needed = bfd_get_symtab_upper_bound (abfd);
CORE_ADDR symaddr = 0;
static CORE_ADDR
bfd_lookup_symbol_from_dyn_symtab (bfd *abfd,
- int (*match_sym) (asymbol *, void *),
- void *data)
+ int (*match_sym) (const asymbol *,
+ const void *),
+ const void *data)
{
long storage_needed = bfd_get_dynamic_symtab_upper_bound (abfd);
CORE_ADDR symaddr = 0;
CORE_ADDR
gdb_bfd_lookup_symbol (bfd *abfd,
- int (*match_sym) (asymbol *, void *),
- void *data)
+ int (*match_sym) (const asymbol *, const void *),
+ const void *data)
{
CORE_ADDR symaddr = gdb_bfd_lookup_symbol_from_symtab (abfd, match_sym, data);