aboutsummaryrefslogtreecommitdiff
path: root/gdb
diff options
context:
space:
mode:
authorSimon Marchi <simon.marchi@efficios.com>2024-09-03 14:41:51 -0400
committerSimon Marchi <simon.marchi@efficios.com>2024-11-11 11:28:24 -0500
commit0fb43ab598d29248a80cc2b34aefa38558e64e8c (patch)
tree9cba60632e5ffef3865d2366441573a30e00242b /gdb
parentfa15972b68a6745eea5f7c1dfe8b6b0c3bd3bc45 (diff)
downloadbinutils-0fb43ab598d29248a80cc2b34aefa38558e64e8c.zip
binutils-0fb43ab598d29248a80cc2b34aefa38558e64e8c.tar.gz
binutils-0fb43ab598d29248a80cc2b34aefa38558e64e8c.tar.bz2
gdb/progspace: make program_space::objfiles_list private
This field is only accessed within the program_space class, make it private. Change-Id: I0b53d78d3d11adf0dfadfb3ecace33d2996dd87b
Diffstat (limited to 'gdb')
-rw-r--r--gdb/progspace.c16
-rw-r--r--gdb/progspace.h10
2 files changed, 13 insertions, 13 deletions
diff --git a/gdb/progspace.c b/gdb/progspace.c
index 94175d3..0734b44 100644
--- a/gdb/progspace.c
+++ b/gdb/progspace.c
@@ -127,8 +127,8 @@ program_space::~program_space ()
bool
program_space::multi_objfile_p () const
{
- return (!objfiles_list.empty ()
- && std::next (objfiles_list.begin ()) != objfiles_list.end ());
+ return (!m_objfiles_list.empty ()
+ && std::next (m_objfiles_list.begin ()) != m_objfiles_list.end ());
}
/* See progspace.h. */
@@ -140,8 +140,8 @@ program_space::free_all_objfiles ()
for (const solib &so : this->solibs ())
gdb_assert (so.objfile == NULL);
- while (!objfiles_list.empty ())
- this->remove_objfile (&objfiles_list.front ());
+ while (!m_objfiles_list.empty ())
+ this->remove_objfile (&m_objfiles_list.front ());
}
/* See progspace.h. */
@@ -151,12 +151,12 @@ program_space::add_objfile (std::unique_ptr<objfile> &&objfile,
struct objfile *before)
{
if (before == nullptr)
- objfiles_list.push_back (std::move (objfile));
+ m_objfiles_list.push_back (std::move (objfile));
else
{
gdb_assert (before->is_linked ());
- objfiles_list.insert (objfiles_list.iterator_to (*before),
- std::move (objfile));
+ m_objfiles_list.insert (m_objfiles_list.iterator_to (*before),
+ std::move (objfile));
}
}
@@ -175,7 +175,7 @@ program_space::remove_objfile (struct objfile *objfile)
symfile_object_file = NULL;
gdb_assert (objfile->is_linked ());
- objfiles_list.erase (objfiles_list.iterator_to (*objfile));
+ m_objfiles_list.erase (m_objfiles_list.iterator_to (*objfile));
}
/* See progspace.h. */
diff --git a/gdb/progspace.h b/gdb/progspace.h
index 4f98b45..d426dfa 100644
--- a/gdb/progspace.h
+++ b/gdb/progspace.h
@@ -193,7 +193,7 @@ struct program_space
for (objfile *objf : pspace->objfiles ()) { ... } */
objfiles_range objfiles ()
{
- return objfiles_range (objfiles_iterator (objfiles_list.begin ()));
+ return objfiles_range (objfiles_iterator (m_objfiles_list.begin ()));
}
using objfiles_safe_range = basic_safe_range<objfiles_range>;
@@ -208,7 +208,7 @@ struct program_space
objfiles_safe_range objfiles_safe ()
{
return objfiles_safe_range
- (objfiles_range (objfiles_iterator (objfiles_list.begin ())));
+ (objfiles_range (objfiles_iterator (m_objfiles_list.begin ())));
}
/* Add OBJFILE to the list of objfiles, putting it just before
@@ -337,9 +337,6 @@ struct program_space
(e.g. the argument to the "symbol-file" or "file" command). */
struct objfile *symfile_object_file = NULL;
- /* All known objfiles are kept in a linked list. */
- owning_intrusive_list<objfile> objfiles_list;
-
/* List of shared objects mapped into this space. Managed by
solib.c. */
owning_intrusive_list<solib> so_list;
@@ -359,6 +356,9 @@ struct program_space
registry<program_space> registry_fields;
private:
+ /* All known objfiles are kept in a linked list. */
+ owning_intrusive_list<objfile> m_objfiles_list;
+
/* The set of target sections matching the sections mapped into
this program space. Managed by both exec_ops and solib.c. */
std::vector<target_section> m_target_sections;