static const registry<program_space>::key<darwin_info>
solib_darwin_pspace_data;
-/* Get the current darwin data. If none is found yet, add it now. This
+/* Get the darwin solib data for PSPACE. If none is found yet, add it now. This
function always returns a valid object. */
-static struct darwin_info *
-get_darwin_info (void)
+static darwin_info *
+get_darwin_info (program_space *pspace)
{
- struct darwin_info *info;
-
- info = solib_darwin_pspace_data.get (current_program_space);
- if (info != NULL)
+ darwin_info *info = solib_darwin_pspace_data.get (pspace);
+ if (info != nullptr)
return info;
- return solib_darwin_pspace_data.emplace (current_program_space);
+ return solib_darwin_pspace_data.emplace (pspace);
}
/* Return non-zero if the version in dyld_all_image is known. */
struct so_list *head = NULL;
struct so_list *tail = NULL;
int i;
- struct darwin_info *info = get_darwin_info ();
+ darwin_info *info = get_darwin_info (current_program_space);
/* Be sure image infos are loaded. */
darwin_load_image_infos (info);
if (!target_has_execution ())
return;
- struct darwin_info *info = get_darwin_info ();
+ darwin_info *info = get_darwin_info (current_program_space);
CORE_ADDR load_addr;
info->all_image_addr = 0;
}
static void
-darwin_clear_solib (void)
+darwin_clear_solib (program_space *pspace)
{
- struct darwin_info *info = get_darwin_info ();
+ darwin_info *info = get_darwin_info (pspace);
info->all_image_addr = 0;
info->all_image.version = 0;
/* Per-program-space data key. */
static const registry<program_space>::key<dsbt_info> solib_dsbt_pspace_data;
-/* Get the current dsbt data. If none is found yet, add it now. This
+/* Get the dsbt solib data for PSPACE. If none is found yet, add it now. This
function always returns a valid object. */
-static struct dsbt_info *
-get_dsbt_info (void)
+static dsbt_info *
+get_dsbt_info (program_space *pspace)
{
- struct dsbt_info *info;
-
- info = solib_dsbt_pspace_data.get (current_program_space);
- if (info != NULL)
+ dsbt_info *info = solib_dsbt_pspace_data.get (pspace);
+ if (info != nullptr)
return info;
- return solib_dsbt_pspace_data.emplace (current_program_space);
+ return solib_dsbt_pspace_data.emplace (pspace);
}
return int_ldmbuf;
}
-
-static struct dsbt_info *get_dsbt_info (void);
-
/* Interrogate the Linux kernel to find out where the program was loaded.
There are two load maps; one for the executable and one for the
interpreter (only in the case of a dynamically linked executable). */
static void
dsbt_get_initial_loadmaps (void)
{
- struct dsbt_info *info = get_dsbt_info ();
+ dsbt_info *info = get_dsbt_info (current_program_space);
gdb::optional<gdb::byte_vector> buf
= target_read_alloc (current_inferior ()->top_target (),
TARGET_OBJECT_FDPIC, "exec");
struct bound_minimal_symbol got_sym;
CORE_ADDR addr;
gdb_byte buf[TIC6X_PTR_SIZE];
- struct dsbt_info *info = get_dsbt_info ();
+ dsbt_info *info = get_dsbt_info (current_program_space);
/* One of our assumptions is that the main executable has been relocated.
Bail out if this has not happened. (Note that post_create_inferior
CORE_ADDR lm_addr;
struct so_list *sos_head = NULL;
struct so_list **sos_next_ptr = &sos_head;
- struct dsbt_info *info = get_dsbt_info ();
+ dsbt_info *info = get_dsbt_info (current_program_space);
/* Make sure that the main executable has been relocated. This is
required in order to find the address of the global offset table,
static int
dsbt_in_dynsym_resolve_code (CORE_ADDR pc)
{
- struct dsbt_info *info = get_dsbt_info ();
+ dsbt_info *info = get_dsbt_info (current_program_space);
return ((pc >= info->interp_text_sect_low && pc < info->interp_text_sect_high)
|| (pc >= info->interp_plt_sect_low && pc < info->interp_plt_sect_high)
enable_break (void)
{
asection *interp_sect;
- struct dsbt_info *info;
if (current_program_space->exec_bfd () == NULL)
return 0;
if (!target_has_execution ())
return 0;
- info = get_dsbt_info ();
+ dsbt_info *info = get_dsbt_info (current_program_space);
info->interp_text_sect_low = 0;
info->interp_text_sect_high = 0;
{
struct int_elf32_dsbt_loadmap *ldm;
int changed;
- struct dsbt_info *info = get_dsbt_info ();
+ dsbt_info *info = get_dsbt_info (current_program_space);
dsbt_get_initial_loadmaps ();
ldm = info->exec_loadmap;
}
static void
-dsbt_clear_solib (void)
+dsbt_clear_solib (program_space *pspace)
{
- struct dsbt_info *info = get_dsbt_info ();
+ dsbt_info *info = get_dsbt_info (pspace);
info->lm_base_cache = 0;
info->main_lm_addr = 0;
It is also called before free_so when SO is about to be freed. */
void (*clear_so) (struct so_list *so);
- /* Reset or free private data structures not associated with
- so_list entries. */
- void (*clear_solib) (void);
+ /* Free private data structures associated to PSPACE. This method
+ should not free resources associated to individual so_list entries,
+ those are cleared by the clear_so method. */
+ void (*clear_solib) (program_space *pspace);
/* Target dependent code to run after child process fork. */
void (*solib_create_inferior_hook) (int from_tty);