/* See block.h. */
void
-block::relocate (struct objfile *objfile, const section_offsets &offsets)
+block::relocate (struct objfile *objfile,
+ gdb::array_view<const CORE_ADDR> offsets)
{
int block_line_section = SECT_OFF_TEXT (objfile);
void
blockvector::relocate (struct objfile *objfile,
- const section_offsets &offsets)
+ gdb::array_view<const CORE_ADDR> offsets)
{
int block_line_section = SECT_OFF_TEXT (objfile);
/* Relocate this block and all contained blocks. OBJFILE is the
objfile holding this block, and OFFSETS is the relocation offsets
to use. */
- void relocate (struct objfile *objfile, const section_offsets &offsets);
+ void relocate (struct objfile *objfile,
+ gdb::array_view<const CORE_ADDR> offsets);
private:
/* Relocate this blockvector and all contained blocks. OBJFILE is
the objfile holding this blockvector, and OFFSETS is the
relocation offsets to use. */
- void relocate (struct objfile *objfile, const section_offsets &offsets);
+ void relocate (struct objfile *objfile,
+ gdb::array_view<const CORE_ADDR> offsets);
private:
/* An address map mapping addresses to blocks in this blockvector.
extern void _initialize_ ## NAME (); \
void _initialize_ ## NAME ()
-/* How to relocate the symbols from each section in a symbol file.
- This is indexed by section numbers. */
-typedef std::vector<CORE_ADDR> section_offsets;
-
#endif /* GDB_DEFS_H */
static int
parse_symbol (SYMR *sh, union aux_ext *ax, char *ext_sh, int bigend,
- const section_offsets §ion_offsets, struct objfile *objfile)
+ gdb::array_view<const CORE_ADDR> section_offsets,
+ struct objfile *objfile)
{
struct gdbarch *gdbarch = objfile->arch ();
const bfd_size_type external_sym_size = debug_swap->external_sym_size;
This routine clobbers top_stack->cur_block and ->cur_st. */
static void
-parse_external (EXTR *es, int bigend, const section_offsets §ion_offsets,
+parse_external (EXTR *es, int bigend,
+ gdb::array_view<const CORE_ADDR> section_offsets,
struct objfile *objfile)
{
union aux_ext *ax;
FDR *fh;
struct linetable *lines;
CORE_ADDR lowest_pdr_addr = 0;
- const section_offsets §ion_offsets = objfile->section_offsets;
+ gdb::array_view<const CORE_ADDR> section_offsets (objfile->section_offsets);
if (pst->readin)
return;
static int
objfile_relocate1 (struct objfile *objfile,
- const section_offsets &new_offsets)
+ gdb::array_view<const CORE_ADDR> new_offsets)
{
- section_offsets delta (objfile->section_offsets.size ());
+ std::vector<CORE_ADDR> delta (objfile->section_offsets.size ());
int something_changed = 0;
void
objfile_relocate (struct objfile *objfile,
- const section_offsets &new_offsets)
+ gdb::array_view<const CORE_ADDR> new_offsets)
{
int changed = 0;
gdb_assert (debug_objfile->section_offsets.size ()
== gdb_bfd_count_sections (debug_objfile->obfd.get ()));
- section_offsets new_debug_offsets
+ std::vector<CORE_ADDR> new_debug_offsets
(debug_objfile->section_offsets.size ());
relative_addr_info_to_section_offsets (new_debug_offsets, objfile_addrs);
static int
objfile_rebase1 (struct objfile *objfile, CORE_ADDR slide)
{
- section_offsets new_offsets (objfile->section_offsets.size (), slide);
+ std::vector<CORE_ADDR> new_offsets (objfile->section_offsets.size (), slide);
return objfile_relocate1 (objfile, new_offsets);
}
minimal symbols) which have been read have been relocated by this
much. Symbols which are yet to be read need to be relocated by it. */
- ::section_offsets section_offsets;
+ std::vector<CORE_ADDR> section_offsets;
/* Indexes in the section_offsets array. These are initialized by the
*_symfile_offsets() family of functions (som_symfile_offsets,
extern void free_objfile_separate_debug (struct objfile *);
-extern void objfile_relocate (struct objfile *, const section_offsets &);
+extern void objfile_relocate (struct objfile *,
+ gdb::array_view<const CORE_ADDR>);
extern void objfile_rebase (struct objfile *, CORE_ADDR);
/* Return true if any objfile of PSPACE has partial symbols. */
warning (_("Target reported unsupported offsets: %s"), buf);
objfile *objf = current_program_space->symfile_object_file;
- section_offsets offs = objf->section_offsets;
+ std::vector<CORE_ADDR> offs = objf->section_offsets;
symfile_segment_data_up data = get_symfile_segment_data (objf->obfd.get ());
do_segments = (data != NULL);
/* Compute and return the OBJFILE's section_offset array, using
the associated loader info (INFO). */
-static section_offsets
+static std::vector<CORE_ADDR>
solib_aix_get_section_offsets (struct objfile *objfile,
lm_info_aix *info)
{
bfd *abfd = objfile->obfd.get ();
- section_offsets offsets (objfile->section_offsets.size ());
+ std::vector<CORE_ADDR> offsets (objfile->section_offsets.size ());
/* .text */
if (current_program_space->symfile_object_file != NULL)
{
objfile *objf = current_program_space->symfile_object_file;
- section_offsets offsets = solib_aix_get_section_offsets (objf,
- &exec_info);
+ std::vector<CORE_ADDR> offsets
+ = solib_aix_get_section_offsets (objf, &exec_info);
objfile_relocate (objf, offsets);
}
info->main_executable_lm_info = new lm_info_dsbt (ldm);
objfile *objf = current_program_space->symfile_object_file;
- section_offsets new_offsets (objf->section_offsets.size ());
+ std::vector<CORE_ADDR> new_offsets (objf->section_offsets.size ());
changed = 0;
for (obj_section &osect : objf->sections ())
main_executable_lm_info = new lm_info_frv (ldm, 0, 0);
objfile *objf = current_program_space->symfile_object_file;
- section_offsets new_offsets (objf->section_offsets.size ());
+ std::vector<CORE_ADDR> new_offsets (objf->section_offsets.size ());
changed = 0;
for (obj_section &osect : objf->sections ())
objfile *objf = current_program_space->symfile_object_file;
if (objf)
{
- section_offsets new_offsets (objf->section_offsets.size (),
- displacement);
+ std::vector<CORE_ADDR> new_offsets (objf->section_offsets.size (),
+ displacement);
objfile_relocate (objf, new_offsets);
}
else if (current_program_space->exec_bfd ())
/* The cached offsets for each section of this shared library,
determined from SEGMENT_BASES, or SECTION_BASES. */
- section_offsets offsets;
+ std::vector<CORE_ADDR> offsets;
};
using lm_info_target_up = std::unique_ptr<lm_info_target>;
the user did not provide an offset. */
static void
-place_section (bfd *abfd, asection *sect, section_offsets &offsets,
+place_section (bfd *abfd, asection *sect, std::vector<CORE_ADDR> &offsets,
CORE_ADDR &lowest)
{
CORE_ADDR start_addr;
filled-in) by addr_info_make_relative into SECTION_OFFSETS. */
void
-relative_addr_info_to_section_offsets (section_offsets §ion_offsets,
+relative_addr_info_to_section_offsets (std::vector<CORE_ADDR> §ion_offsets,
const section_addr_info &addrs)
{
int i;
if (cur_sec == NULL)
{
- section_offsets &offsets = objfile->section_offsets;
+ std::vector<CORE_ADDR> &offsets = objfile->section_offsets;
/* Pick non-overlapping offsets for sections the user did not
place explicitly. */
CORE_ADDR offset)
{
/* Add OFFSET to all sections by default. */
- section_offsets offsets (objf->section_offsets.size (), offset);
+ std::vector<CORE_ADDR> offsets (objf->section_offsets.size (), offset);
/* Create sorted lists of all sections in ADDRS as well as all
sections in OBJF. */
int
symfile_map_offsets_to_segments (bfd *abfd,
const struct symfile_segment_data *data,
- section_offsets &offsets,
+ std::vector<CORE_ADDR> &offsets,
int num_segment_bases,
const CORE_ADDR *segment_bases)
{
build_section_addr_info_from_objfile (const struct objfile *objfile);
extern void relative_addr_info_to_section_offsets
- (section_offsets §ion_offsets, const section_addr_info &addrs);
+ (std::vector<CORE_ADDR> §ion_offsets, const section_addr_info &addrs);
extern void addr_info_make_relative (section_addr_info *addrs,
bfd *abfd);
extern int symfile_map_offsets_to_segments (bfd *,
const struct symfile_segment_data *,
- section_offsets &,
+ std::vector<CORE_ADDR> &,
int, const CORE_ADDR *);
symfile_segment_data_up get_symfile_segment_data (bfd *abfd);
/* See symtab.h. */
void
-symbol::relocate (const section_offsets &delta)
+symbol::relocate (gdb::array_view<const CORE_ADDR> delta)
{
if ((loc_class () == LOC_LABEL || loc_class () == LOC_STATIC)
&& section_index () >= 0)
/* Relocate this symbol. OFFSETS is the relocation offsets to use. */
- void relocate (const section_offsets &offsets);
+ void relocate (gdb::array_view<const CORE_ADDR> offsets);
/* Data type of value */