aboutsummaryrefslogtreecommitdiff
path: root/gdb/exec.c
diff options
context:
space:
mode:
authorTom Tromey <tom@tromey.com>2020-10-29 15:04:33 -0600
committerTom Tromey <tom@tromey.com>2020-10-29 15:04:33 -0600
commit6be2a9ab1fba5f876c8cb2566280c5e4e6959d6e (patch)
treeb56cebc7b136717accecbf580534524078a6e91c /gdb/exec.c
parent8ee54925b48985e8e7102221e698bf50b800dd81 (diff)
downloadfsf-binutils-gdb-6be2a9ab1fba5f876c8cb2566280c5e4e6959d6e.zip
fsf-binutils-gdb-6be2a9ab1fba5f876c8cb2566280c5e4e6959d6e.tar.gz
fsf-binutils-gdb-6be2a9ab1fba5f876c8cb2566280c5e4e6959d6e.tar.bz2
Add target_section constructor
This adds a constructor to target_section, simplifying the code that creates instances of this. gdb/ChangeLog 2020-10-29 Tom Tromey <tom@tromey.com> * target-section.h (struct target_section): Add constructor. * exec.c (build_section_table, add_target_sections_of_objfile): Update. * corelow.c (core_target::build_file_mappings): Update.
Diffstat (limited to 'gdb/exec.c')
-rw-r--r--gdb/exec.c18
1 files changed, 6 insertions, 12 deletions
diff --git a/gdb/exec.c b/gdb/exec.c
index f95fdce..9bdd87d 100644
--- a/gdb/exec.c
+++ b/gdb/exec.c
@@ -598,12 +598,9 @@ build_section_table (struct bfd *some_bfd)
if (!(aflag & SEC_ALLOC))
continue;
- table.emplace_back ();
- target_section &sect = table.back ();
- sect.owner = NULL;
- sect.the_bfd_section = asect;
- sect.addr = bfd_section_vma (asect);
- sect.endaddr = sect.addr + bfd_section_size (asect);
+ table.emplace_back (bfd_section_vma (asect),
+ bfd_section_vma (asect) + bfd_section_size (asect),
+ asect);
}
return table;
@@ -662,12 +659,9 @@ add_target_sections_of_objfile (struct objfile *objfile)
if (bfd_section_size (osect->the_bfd_section) == 0)
continue;
- table->emplace_back ();
- target_section &ts = table->back ();
- ts.addr = obj_section_addr (osect);
- ts.endaddr = obj_section_endaddr (osect);
- ts.the_bfd_section = osect->the_bfd_section;
- ts.owner = (void *) objfile;
+ table->emplace_back (obj_section_addr (osect),
+ obj_section_endaddr (osect),
+ osect->the_bfd_section, (void *) objfile);
}
}