aboutsummaryrefslogtreecommitdiff
path: root/gdb
diff options
context:
space:
mode:
authorSimon Marchi <simon.marchi@polymtl.ca>2024-05-16 14:04:24 -0400
committerSimon Marchi <simon.marchi@efficios.com>2024-07-15 14:34:12 -0400
commit93016848f9458ebaec5a92950f7c97e66bb5732e (patch)
tree11aa3bddc44ef2f3d29569b9e370bc68944b3480 /gdb
parent574b77fccb8b7420c2ae4ab758d472c75c396a33 (diff)
downloadgdb-93016848f9458ebaec5a92950f7c97e66bb5732e.zip
gdb-93016848f9458ebaec5a92950f7c97e66bb5732e.tar.gz
gdb-93016848f9458ebaec5a92950f7c97e66bb5732e.tar.bz2
gdb: use objfile::pspace in objfile::unlink
I think it would make sense to use objfile::pspace instead of the current program space here. It reduces the risks of calling this method with the wrong current program space set. Change-Id: Id4f3644719f232640c83a1c7f4aa92eaa6af6c5c Approved-By: Tom Tromey <tom@tromey.com> Reviewed-By: Thiago Jung Bauermann <thiago.bauermann@linaro.org>
Diffstat (limited to 'gdb')
-rw-r--r--gdb/objfiles.c2
-rw-r--r--gdb/objfiles.h2
2 files changed, 2 insertions, 2 deletions
diff --git a/gdb/objfiles.c b/gdb/objfiles.c
index 3d50db4..822376b 100644
--- a/gdb/objfiles.c
+++ b/gdb/objfiles.c
@@ -463,7 +463,7 @@ objfile::make (gdb_bfd_ref_ptr bfd_, const char *name_, objfile_flags flags_,
void
objfile::unlink ()
{
- current_program_space->remove_objfile (this);
+ this->pspace ()->remove_objfile (this);
}
/* Free all separate debug objfile of OBJFILE, but don't free OBJFILE
diff --git a/gdb/objfiles.h b/gdb/objfiles.h
index 320e809..b166f0e 100644
--- a/gdb/objfiles.h
+++ b/gdb/objfiles.h
@@ -439,7 +439,7 @@ public:
static objfile *make (gdb_bfd_ref_ptr bfd_, const char *name_,
objfile_flags flags_, objfile *parent = nullptr);
- /* Remove an objfile from the current program space, and free
+ /* Remove this objfile from its program space's objfile list, and frees
it. */
void unlink ();