aboutsummaryrefslogtreecommitdiff
path: root/gdb/objfiles.c
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/objfiles.c
parent574b77fccb8b7420c2ae4ab758d472c75c396a33 (diff)
downloadbinutils-93016848f9458ebaec5a92950f7c97e66bb5732e.zip
binutils-93016848f9458ebaec5a92950f7c97e66bb5732e.tar.gz
binutils-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/objfiles.c')
-rw-r--r--gdb/objfiles.c2
1 files changed, 1 insertions, 1 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