public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Simon Marchi <simon.marchi@polymtl.ca>
To: gdb-patches@sourceware.org
Cc: Simon Marchi <simon.marchi@efficios.com>
Subject: [PATCH 8/8] gdb: use objfile->pspace in free_objfile observers
Date: Tue,  3 Oct 2023 22:20:23 -0400	[thread overview]
Message-ID: <20231004022305.298534-9-simon.marchi@polymtl.ca> (raw)
In-Reply-To: <20231004022305.298534-1-simon.marchi@polymtl.ca>

From: Simon Marchi <simon.marchi@efficios.com>

Use objfile->pspace instead of current_program_space.

Change-Id: I127a1788e155b321563114452ed5b530f1d1f618
---
 gdb/solib.c   | 2 +-
 gdb/symfile.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/gdb/solib.c b/gdb/solib.c
index f914822d2096..5280e5ffefd7 100644
--- a/gdb/solib.c
+++ b/gdb/solib.c
@@ -1739,7 +1739,7 @@ remove_user_added_objfile (struct objfile *objfile)
 {
   if (objfile != 0 && objfile->flags & OBJF_USERLOADED)
     {
-      for (struct so_list *so : current_program_space->solibs ())
+      for (struct so_list *so : objfile->pspace->solibs ())
 	if (so->objfile == objfile)
 	  so->objfile = NULL;
     }
diff --git a/gdb/symfile.c b/gdb/symfile.c
index c2779681cd21..e3228d1925f0 100644
--- a/gdb/symfile.c
+++ b/gdb/symfile.c
@@ -3736,7 +3736,7 @@ static void
 symfile_free_objfile (struct objfile *objfile)
 {
   /* Remove the target sections owned by this objfile.  */
-  current_program_space->remove_target_sections (objfile);
+  objfile->pspace->remove_target_sections (objfile);
 }
 
 /* Wrapper around the quick_symbol_functions expand_symtabs_matching "method".
-- 
2.42.0


  parent reply	other threads:[~2023-10-04  2:25 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-10-04  2:20 [PATCH 0/8] Split new_objfile observable Simon Marchi
2023-10-04  2:20 ` [PATCH 1/8] gdb: add program_space parameter to ada_clear_symbol_cache Simon Marchi
2023-10-04  2:20 ` [PATCH 2/8] gdb: add program_space parameters to some functions in symtab.c Simon Marchi
2023-10-04  2:20 ` [PATCH 3/8] gdb: add program_space parameter to emit_clear_objfiles_event Simon Marchi
2023-10-04  2:20 ` [PATCH 4/8] gdb: use objfile->pspace in auto-load.c Simon Marchi
2023-10-04  2:20 ` [PATCH 5/8] gdb: add program_space parameters to some auto-load functions Simon Marchi
2023-10-04  2:20 ` [PATCH 6/8] gdb: add all_objfiles_removed observer Simon Marchi
2023-10-05 16:35   ` Tom Tromey
2023-10-05 17:13     ` Simon Marchi
2023-10-04  2:20 ` [PATCH 7/8] gdb: remove unnecessary nullptr check in free_objfile observers Simon Marchi
2023-10-04  2:20 ` Simon Marchi [this message]
2023-10-05 16:36 ` [PATCH 0/8] Split new_objfile observable Tom Tromey
2023-10-05 17:23   ` Simon Marchi

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=20231004022305.298534-9-simon.marchi@polymtl.ca \
    --to=simon.marchi@polymtl.ca \
    --cc=gdb-patches@sourceware.org \
    --cc=simon.marchi@efficios.com \
    /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).