gdb: make symfile_segment_data::segment_info an std::vector

Change the symfile_segment_data::segment_info array to be an
std::vector.  No functional changes are expected.

gdb/ChangeLog:

	* symfile.h (struct symfile_segment_data)
	<~symfile_segment_data>: Remove.
	<segment_info>: Change to std::vector.
	* symfile.c (default_symfile_segments): Update.
	* elfread.c (elf_symfile_segments): Update.
This commit is contained in:
Simon Marchi
2020-05-19 12:18:05 -04:00
parent 68b888fff3
commit 9005fbbb00
4 changed files with 15 additions and 8 deletions

View File

@ -118,7 +118,9 @@ elf_symfile_segments (bfd *abfd)
data->segments.emplace_back (segments[i]->p_vaddr, segments[i]->p_memsz);
num_sections = bfd_count_sections (abfd);
data->segment_info = XCNEWVEC (int, num_sections);
/* All elements are initialized to 0 (map to no segment). */
data->segment_info.resize (num_sections);
for (i = 0, sect = abfd->sections; sect != NULL; i++, sect = sect->next)
{