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.
This commit is contained in:
Tom Tromey 2020-10-29 15:04:33 -06:00
parent 8ee54925b4
commit 6be2a9ab1f
4 changed files with 23 additions and 18 deletions

View file

@ -266,12 +266,7 @@ core_target::build_file_mappings ()
bfd_set_section_alignment (sec, 2);
/* Set target_section fields. */
m_core_file_mappings.emplace_back ();
target_section &ts = m_core_file_mappings.back ();
ts.addr = start;
ts.endaddr = end;
ts.owner = nullptr;
ts.the_bfd_section = sec;
m_core_file_mappings.emplace_back (start, end, sec);
});
normalize_mem_ranges (&m_core_unavailable_mappings);