{
if (core_bfd)
{
- int pid = ptid_get_pid (inferior_ptid);
inferior_ptid = null_ptid; /* Avoid confusion from thread
stuff. */
- if (pid != 0)
- exit_inferior_silent (pid);
+ exit_inferior_silent (current_inferior ());
/* Clear out solib state while the bfd is still open. See
comments in clear_solib in solib.c. */
inf->fake_pid_p = fake_pid_p;
}
- ptid = ptid_build (pid, lwpid, 0);
+ ptid = ptid_t (pid, lwpid, 0);
add_thread (ptid);
bfd_map_over_sections (core_bfd, add_to_thread_list,
bfd_get_section_by_name (core_bfd, ".reg"));
- if (ptid_equal (inferior_ptid, null_ptid))
+ if (inferior_ptid == null_ptid)
{
/* Either we found no .reg/NN section, and hence we have a
non-threaded core (single-threaded, from gdb's perspective),
which was the "main" thread. The latter case shouldn't
usually happen, but we're dealing with input here, which can
always be broken in different ways. */
- struct thread_info *thread = first_thread_of_process (-1);
+ thread_info *thread = first_thread_of_inferior (current_inferior ());
if (thread == NULL)
{
inferior_appeared (current_inferior (), CORELOW_PID);
- inferior_ptid = pid_to_ptid (CORELOW_PID);
+ inferior_ptid = ptid_t (CORELOW_PID);
add_thread_silent (inferior_ptid);
}
else
- switch_to_thread (thread->ptid);
+ switch_to_thread (thread);
}
post_create_inferior (target, from_tty);
/* Mark all registers not found in the core as unavailable. */
for (i = 0; i < gdbarch_num_regs (regcache->arch ()); i++)
if (regcache->get_register_status (i) == REG_UNKNOWN)
- regcache_raw_supply (regcache, i, NULL);
+ regcache->raw_supply (i, NULL);
}
void
return TARGET_XFER_E_IO;
default:
- return this->beneath->xfer_partial (object, annex, readbuf,
- writebuf, offset, len,
- xfered_len);
+ return this->beneath ()->xfer_partial (object, annex, readbuf,
+ writebuf, offset, len,
+ xfered_len);
}
}
return result;
}
- return this->beneath->read_description ();
+ return this->beneath ()->read_description ();
}
const char *
"process", with normal_pid_to_str. */
/* Try the LWPID field first. */
- pid = ptid_get_lwp (ptid);
+ pid = ptid.lwp ();
if (pid != 0)
- return normal_pid_to_str (pid_to_ptid (pid));
+ return normal_pid_to_str (ptid_t (pid));
/* Otherwise, this isn't a "threaded" core -- use the PID field, but
only if it isn't a fake PID. */