.reg/1, .reg2/1, .reg/2, .reg2/2
After calling this function the rest of the core file handling code can
- treat this core file just like any other core file. */
+ treat this core file just like any other core file.
+
+ CBFD is the core file being loaded, and INF is the inferior through
+ which the core file will be examined. */
static void
-rename_vmcore_idle_reg_sections (bfd *abfd, inferior *inf)
+rename_vmcore_idle_reg_sections (bfd *cbfd, inferior *inf)
{
/* Map from the bfd section to its lwpid (the /NN number). */
std::vector<std::pair<asection *, int>> sections_and_lwpids;
/* Look for all the .reg sections. Record the section object and the
lwpid which is extracted from the section name. Spot if any have an
lwpid of zero. */
- for (asection *sect : gdb_bfd_sections (current_program_space->core_bfd ()))
+ for (asection *sect : gdb_bfd_sections (cbfd))
{
if (startswith (bfd_section_name (sect), ".reg/"))
{
std::string replacement_lwpid_str;
auto iter = sections_and_lwpids.begin ();
int replacement_lwpid = 0;
- for (asection *sect : gdb_bfd_sections (current_program_space->core_bfd ()))
+ for (asection *sect : gdb_bfd_sections (cbfd))
{
if (iter != sections_and_lwpids.end () && sect == iter->first)
{
static_cast<int> (len - 2),
name, replacement_lwpid);
char *name_buf
- = static_cast<char *> (bfd_alloc (abfd, name_str.size () + 1));
+ = static_cast<char *> (bfd_alloc (cbfd, name_str.size () + 1));
if (name_buf == nullptr)
error (_("failed to allocate space for section name '%s'"),
name_str.c_str ());