build_section_table cannot fail

I noticed that build_section_table cannot fail.  This patch changes it
to return a target_section_table and then removes the dead code.

gdb/ChangeLog
2020-10-12  Tom Tromey  <tom@tromey.com>

	* solib.c (solib_map_sections): Update.
	* record-full.c (record_full_core_open_1): Update.
	* exec.h (build_section_table): Return a target_section_table.
	* exec.c (exec_file_attach): Update.
	(build_section_table): Return a target_section_table.
	* corelow.c (core_target::core_target): Update.
	* bfd-target.c (target_bfd::target_bfd): Update.
This commit is contained in:
Tom Tromey
2020-10-12 15:53:16 -06:00
parent bb2a67773c
commit 2d128614d4
7 changed files with 26 additions and 39 deletions

View File

@ -554,11 +554,7 @@ solib_map_sections (struct so_list *so)
if (so->sections == nullptr)
so->sections = new target_section_table;
if (build_section_table (so->abfd, so->sections))
{
error (_("Can't find the file sections in `%s': %s"),
bfd_get_filename (so->abfd), bfd_errmsg (bfd_get_error ()));
}
*so->sections = build_section_table (so->abfd);
for (target_section &p : so->sections->sections)
{