+2020-10-29 Tom Tromey <tom@tromey.com>
+
+ * symfile.c (add_symbol_file_command): Update.
+ * exec.c (program_space::add_target_sections): Rename.
+ * symfile-mem.c (symbol_file_add_from_memory): Update.
+ * progspace.h (struct program_space) <add_target_sections>:
+ Declare new overload.
+ * exec.h (add_target_sections_of_objfile): Don't declare.
+
2020-10-29 Tom Tromey <tom@tromey.com>
* solib.c (solib_map_sections): Update.
/* Add the sections of OBJFILE to the current set of target sections. */
void
-add_target_sections_of_objfile (struct objfile *objfile)
+program_space::add_target_sections (struct objfile *objfile)
{
- target_section_table *table = ¤t_program_space->target_sections;
struct obj_section *osect;
gdb_assert (objfile != nullptr);
if (bfd_section_size (osect->the_bfd_section) == 0)
continue;
- table->emplace_back (obj_section_addr (osect),
- obj_section_endaddr (osect),
- osect->the_bfd_section, (void *) objfile);
+ target_sections.emplace_back (obj_section_addr (osect),
+ obj_section_endaddr (osect),
+ osect->the_bfd_section, (void *) objfile);
}
}
/* Set the loaded address of a section. */
extern void exec_set_section_address (const char *, int, CORE_ADDR);
-/* Add the sections of OBJFILE to the current set of target sections.
- * OBJFILE owns the new target sections. */
-
-extern void add_target_sections_of_objfile (struct objfile *objfile);
-
/* Prints info about all sections defined in the TABLE. ABFD is
special cased --- it's filename is omitted; if it is the executable
file, its entry point is printed. */
void add_target_sections (void *owner,
const target_section_table §ions);
+ /* Add the sections of OBJFILE to the current set of target
+ sections. They are given OBJFILE as the "owner". */
+ void add_target_sections (struct objfile *objfile);
+
/* Unique ID number. */
int num = 0;
objf = symbol_file_add_from_bfd (nbfd, bfd_get_filename (nbfd),
add_flags, &sai, OBJF_SHARED, NULL);
- add_target_sections_of_objfile (objf);
+ current_program_space->add_target_sections (objf);
/* This might change our ideas about frames already looked at. */
reinit_frame_cache ();
if (seen_offset)
set_objfile_default_section_offset (objf, section_addrs, offset);
- add_target_sections_of_objfile (objf);
+ current_program_space->add_target_sections (objf);
/* Getting new symbols may change our opinion about what is
frameless. */