gdb: use std::vector to store segments in symfile_segment_data
authorSimon Marchi <simon.marchi@efficios.com>
Tue, 19 May 2020 16:18:04 +0000 (12:18 -0400)
committerSimon Marchi <simon.marchi@efficios.com>
Tue, 19 May 2020 16:18:36 +0000 (12:18 -0400)
commit68b888fff3164b5e8e347d9c1ca351c366f0aac4
tree407df662edc349c3ec33bf23379f33d3bce06cd4
parent62982abdee45cb20a7cfadb2b1bcc358655d4ad3
gdb: use std::vector to store segments in symfile_segment_data

Instead of maintaining two vectors, I added a small `segment` class
which holds both the base address and size of one segment and replaced
the two `segment_bases` and `segment_sizes` arrays with a single vector.

The rest of the changes are straightforward, no behavior changes are
expected.

gdb/ChangeLog:

* symfile.h (struct symfile_segment_data) <struct segment>: New.
<segments>: New.
<segment_bases, segment_sizes>: Remove.
* symfile.c (default_symfile_segments): Update.
* elfread.c (elf_symfile_segments): Update.
* remote.c (remote_target::get_offsets): Update.
* solib-target.c (solib_target_relocate_section_addresses):
Update.
gdb/ChangeLog
gdb/elfread.c
gdb/remote.c
gdb/solib-target.c
gdb/symfile.c
gdb/symfile.h