aboutsummaryrefslogtreecommitdiff
path: root/gdb
diff options
context:
space:
mode:
authorSimon Marchi <simon.marchi@ericsson.com>2017-05-02 14:25:43 -0400
committerSimon Marchi <simon.marchi@ericsson.com>2017-05-02 14:25:43 -0400
commitd17f7b365cf3896b3129b9077d55b3154fc43131 (patch)
tree68146eecf2cce5d3204e44993bfe24a7cfccb1e6 /gdb
parentb560ebd6605503276e09b2ef75c94e1d10f176f2 (diff)
downloadgdb-d17f7b365cf3896b3129b9077d55b3154fc43131.zip
gdb-d17f7b365cf3896b3129b9077d55b3154fc43131.tar.gz
gdb-d17f7b365cf3896b3129b9077d55b3154fc43131.tar.bz2
solib-target: Remove local variables
Now that we use std::vector, these local variables are not very useful. They're not much shorter than the expressions they stand for. gdb/ChangeLog: * solib-target.c (solib_target_relocate_section_addresses): Remove num_section_bases, num_bases, segment_bases variables.
Diffstat (limited to 'gdb')
-rw-r--r--gdb/ChangeLog5
-rw-r--r--gdb/solib-target.c22
2 files changed, 14 insertions, 13 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index b82cfd5..f441585 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,8 @@
+2017-05-02 Simon Marchi <simon.marchi@ericsson.com>
+
+ * solib-target.c (solib_target_relocate_section_addresses):
+ Remove num_section_bases, num_bases, segment_bases variables.
+
2017-05-02 Simon Marchi <simon.marchi@polymtl.ca>
* common/gdb_vecs.h (DEF_VEC_I (CORE_ADDR)): Remove.
diff --git a/gdb/solib-target.c b/gdb/solib-target.c
index 2e9b962..71a0da3 100644
--- a/gdb/solib-target.c
+++ b/gdb/solib-target.c
@@ -347,7 +347,6 @@ solib_target_relocate_section_addresses (struct so_list *so,
{
int i;
asection *sect;
- int num_section_bases = li->section_bases.size ();
int num_alloc_sections = 0;
for (i = 0, sect = so->abfd->sections;
@@ -356,7 +355,7 @@ solib_target_relocate_section_addresses (struct so_list *so,
if ((bfd_get_section_flags (so->abfd, sect) & SEC_ALLOC))
num_alloc_sections++;
- if (num_alloc_sections != num_section_bases)
+ if (num_alloc_sections != li->section_bases.size ())
warning (_("\
Could not relocate shared library \"%s\": wrong number of ALLOC sections"),
so->so_name);
@@ -407,37 +406,34 @@ Could not relocate shared library \"%s\": no segments"), so->so_name);
{
ULONGEST orig_delta;
int i;
- int num_bases;
- CORE_ADDR *segment_bases;
-
- num_bases = li->segment_bases.size ();
- segment_bases = li->segment_bases.data ();
if (!symfile_map_offsets_to_segments (so->abfd, data, li->offsets,
- num_bases, segment_bases))
+ li->segment_bases.size (),
+ li->segment_bases.data ()))
warning (_("\
Could not relocate shared library \"%s\": bad offsets"), so->so_name);
/* Find the range of addresses to report for this library in
"info sharedlibrary". Report any consecutive segments
which were relocated as a single unit. */
- gdb_assert (num_bases > 0);
- orig_delta = segment_bases[0] - data->segment_bases[0];
+ gdb_assert (li->segment_bases.size () > 0);
+ orig_delta = li->segment_bases[0] - data->segment_bases[0];
for (i = 1; i < data->num_segments; i++)
{
/* If we have run out of offsets, assume all
remaining segments have the same offset. */
- if (i >= num_bases)
+ if (i >= li->segment_bases.size ())
continue;
/* If this segment does not have the same offset, do
not include it in the library's range. */
- if (segment_bases[i] - data->segment_bases[i] != orig_delta)
+ if (li->segment_bases[i] - data->segment_bases[i]
+ != orig_delta)
break;
}
- so->addr_low = segment_bases[0];
+ so->addr_low = li->segment_bases[0];
so->addr_high = (data->segment_bases[i - 1]
+ data->segment_sizes[i - 1]
+ orig_delta);