gdb: remove core_bfd macro

The core_bfd macro hides a use of current_program_space.  Remove it, so
that we have the opportunity to get the program space from the context,
if possible.  I guess that the macro was introduced at some point to
replace a global variable of the same name without changing all the
uses.

Change-Id: I971a65b29b5e5a5941f3cb7ea234547daa787268
Approved-By: Tom Tromey <tom@tromey.com>
This commit is contained in:
Simon Marchi
2024-02-05 16:13:58 -05:00
parent 0afc614c99
commit 6fdf95ae53
18 changed files with 213 additions and 181 deletions

View File

@@ -300,9 +300,7 @@ struct program_space
/* Return the exec BFD for this program space. */
bfd *exec_bfd () const
{
return ebfd.get ();
}
{ return ebfd.get (); }
/* Set the exec BFD for this program space to ABFD. */
void set_exec_bfd (gdb_bfd_ref_ptr &&abfd)
@@ -310,6 +308,9 @@ struct program_space
ebfd = std::move (abfd);
}
bfd *core_bfd () const
{ return cbfd.get (); }
/* Reset saved solib data at the start of an solib event. This lets
us properly collect the data when calling solib_add, so it can then
later be printed. */