aboutsummaryrefslogtreecommitdiff
path: root/gdb/target-section.h
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/target-section.h
parent8ee54925b48985e8e7102221e698bf50b800dd81 (diff)
downloadgdb-6be2a9ab1fba5f876c8cb2566280c5e4e6959d6e.zip
gdb-6be2a9ab1fba5f876c8cb2566280c5e4e6959d6e.tar.gz
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/target-section.h')
-rw-r--r--gdb/target-section.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/gdb/target-section.h b/gdb/target-section.h
index ec6932d..b19bcf9 100644
--- a/gdb/target-section.h
+++ b/gdb/target-section.h
@@ -26,6 +26,15 @@
struct target_section
{
+ target_section (CORE_ADDR addr_, CORE_ADDR end_, struct bfd_section *sect_,
+ void *owner_ = nullptr)
+ : addr (addr_),
+ endaddr (end_),
+ the_bfd_section (sect_),
+ owner (owner_)
+ {
+ }
+
/* Lowest address in section. */
CORE_ADDR addr;
/* Highest address in section, plus 1. */