]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
Remove clear_section_table
authorTom Tromey <tom@tromey.com>
Mon, 12 Oct 2020 21:53:16 +0000 (15:53 -0600)
committerTom Tromey <tom@tromey.com>
Tue, 13 Oct 2020 02:18:48 +0000 (20:18 -0600)
The call to clear_section_table in ~program_space is now clearly not
needed -- the section table will clear itself.  This patch removes
this call and then inlines the one remaining call to
clear_section_table.

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

* progspace.c (program_space::~program_space): Don't call
clear_section_table.
* exec.h (clear_section_table): Don't declare.
* exec.c (exec_target::close): Update.
(clear_section_table): Remove.

gdb/ChangeLog
gdb/exec.c
gdb/exec.h
gdb/progspace.c

index 6cf0b267418bb921354bfdf853f6ac225473af3d..849bfe205b5eed9be9b01f70099864d2d23be681 100644 (file)
@@ -1,3 +1,11 @@
+2020-10-12  Tom Tromey  <tom@tromey.com>
+
+       * progspace.c (program_space::~program_space): Don't call
+       clear_section_table.
+       * exec.h (clear_section_table): Don't declare.
+       * exec.c (exec_target::close): Update.
+       (clear_section_table): Remove.
+
 2020-10-12  Tom Tromey  <tom@tromey.com>
 
        * exec.c (add_target_sections_of_objfile): Simplify.
index 43385fe978f273fc1bb5cf087e0bc3b653ecc4da..ab47757c2b4b4b686905b75fd6dbb3595c7f2df5 100644 (file)
@@ -183,7 +183,7 @@ exec_target::close ()
   for (struct program_space *ss : program_spaces)
     {
       set_current_program_space (ss);
-      clear_section_table (current_target_sections);
+      current_target_sections->sections.clear ();
       exec_close ();
     }
 }
@@ -577,14 +577,6 @@ file_command (const char *arg, int from_tty)
 }
 \f
 
-/* See exec.h.  */
-
-void
-clear_section_table (struct target_section_table *table)
-{
-  table->sections.clear ();
-}
-
 /* Builds a section table, given args BFD, TABLE.  */
 
 target_section_table
index 75177dda96a6942d766c4e0ade152ca1dc7f9817..f28a033428d4cb6f1bd9b29d758995504ec65d77 100644 (file)
@@ -38,10 +38,6 @@ struct objfile;
 
 extern target_section_table build_section_table (struct bfd *);
 
-/* Remove all entries from TABLE.  */
-
-extern void clear_section_table (struct target_section_table *table);
-
 /* The current inferior is a child vforked and its program space is
    shared with its parent.  This pushes the exec target on the
    current/child inferior's target stack if there are sections in the
index 3f5121612154751d480f2648df7c483df571fc71..67ea8bdb9e9a1407aecb0f5ce8e5a488586d0df5 100644 (file)
@@ -154,7 +154,6 @@ program_space::~program_space ()
   clear_symtab_users (SYMFILE_DEFER_BP_RESET);
   if (!gdbarch_has_shared_address_space (target_gdbarch ()))
     free_address_space (this->aspace);
-  clear_section_table (&this->target_sections);
   clear_program_space_solib_cache (this);
     /* Discard any data modules have associated with the PSPACE.  */
   program_space_free_data (this);