public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Tom Tromey <tom@tromey.com>
To: gdb-patches@sourceware.org
Cc: Tom Tromey <tom@tromey.com>
Subject: [PATCH 5/6] Remove clear_section_table
Date: Sat,  3 Oct 2020 13:37:34 -0600	[thread overview]
Message-ID: <20201003193735.2532-6-tom@tromey.com> (raw)
In-Reply-To: <20201003193735.2532-1-tom@tromey.com>

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.

2020-10-03  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   |  8 ++++++++
 gdb/exec.c      | 10 +---------
 gdb/exec.h      |  4 ----
 gdb/progspace.c |  1 -
 4 files changed, 9 insertions(+), 14 deletions(-)

diff --git a/gdb/exec.c b/gdb/exec.c
index 43385fe978f..ab47757c2b4 100644
--- a/gdb/exec.c
+++ b/gdb/exec.c
@@ -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
diff --git a/gdb/exec.h b/gdb/exec.h
index 75177dda96a..f28a033428d 100644
--- a/gdb/exec.h
+++ b/gdb/exec.h
@@ -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
diff --git a/gdb/progspace.c b/gdb/progspace.c
index 3f512161215..67ea8bdb9e9 100644
--- a/gdb/progspace.c
+++ b/gdb/progspace.c
@@ -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);
-- 
2.17.2


  parent reply	other threads:[~2020-10-03 19:37 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-03 19:37 [PATCH 0/6] Change target section table management Tom Tromey
2020-10-03 19:37 ` [PATCH 1/6] Introduce target-section.h Tom Tromey
2020-10-04  8:29   ` Andrew Burgess
2020-10-09  1:17     ` Tom Tromey
2020-10-03 19:37 ` [PATCH 2/6] Use a std::vector in target_section_table Tom Tromey
2020-10-13 16:41   ` Luis Machado
2020-10-13 20:35     ` Tom Tromey
2020-10-13 22:48       ` Luis Machado
2020-10-14 12:58         ` Tom Tromey
2020-10-14 13:01           ` Luis Machado
2020-10-14 13:18             ` Tom Tromey
2020-10-14 13:23               ` Luis Machado
2020-10-14 14:06                 ` Simon Marchi
2020-10-14  9:09   ` Tom de Vries
2020-11-10 17:38   ` Simon Marchi
2020-10-03 19:37 ` [PATCH 3/6] build_section_table cannot fail Tom Tromey
2020-10-04  8:38   ` Andrew Burgess
2020-10-03 19:37 ` [PATCH 4/6] Simplify add_target_sections_of_objfile Tom Tromey
2020-10-04  8:40   ` Andrew Burgess
2020-10-03 19:37 ` Tom Tromey [this message]
2020-10-04  8:44   ` [PATCH 5/6] Remove clear_section_table Andrew Burgess
2020-10-03 19:37 ` [PATCH 6/6] Change target_section_table to std::vector alias Tom Tromey
2020-10-04  8:46   ` Andrew Burgess
2020-10-13  2:19 ` [PATCH 0/6] Change target section table management Tom Tromey

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20201003193735.2532-6-tom@tromey.com \
    --to=tom@tromey.com \
    --cc=gdb-patches@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).