thread_info *find_thread_in_random
(ptid_t ptid, gdb::function_view<bool (thread_info *)> func);
-/* Get the pid of THREAD. */
-
-static inline int
-pid_of (const thread_info *thread)
-{
- return thread->id.pid ();
-}
-
/* Switch the current thread. */
void switch_to_thread (thread_info *thread);
int ret;
enum target_hw_bp_type targ_type;
struct aarch64_debug_reg_state *state
- = aarch64_get_debug_reg_state (pid_of (current_thread));
+ = aarch64_get_debug_reg_state (current_thread->id.pid ());
if (show_debug_regs)
fprintf (stderr, "insert_point on entry (addr=0x%08lx, len=%d)\n",
int ret;
enum target_hw_bp_type targ_type;
struct aarch64_debug_reg_state *state
- = aarch64_get_debug_reg_state (pid_of (current_thread));
+ = aarch64_get_debug_reg_state (current_thread->id.pid ());
if (show_debug_regs)
fprintf (stderr, "remove_point on entry (addr=0x%08lx, len=%d)\n",
= aarch64_remove_non_address_bits ((CORE_ADDR) siginfo.si_addr);
/* Check if the address matches any watched address. */
- state = aarch64_get_debug_reg_state (pid_of (current_thread));
+ state = aarch64_get_debug_reg_state (current_thread->id.pid ());
CORE_ADDR result;
if (aarch64_stopped_data_address (state, addr_trap, &result))
return result;
{
struct thread_info *thread = get_lwp_thread (lwp);
int pid = thread->id.lwp ();
- struct process_info *proc = find_process_pid (pid_of (thread));
+ process_info *proc = find_process_pid (thread->id.pid ());
struct arch_process_info *proc_info = proc->priv->arch_private;
struct arch_lwp_info *lwp_info = lwp->arch_private;
int i;
if (WIFSTOPPED (wstat))
{
- struct process_info *proc;
-
/* Architecture-specific setup after inferior is running. */
- proc = find_process_pid (pid_of (thread));
+ process_info *proc = find_process_pid (thread->id.pid ());
+
if (proc->tdesc == NULL)
{
if (proc->attached)
if (WIFSTOPPED (wstat) && child->must_set_ptrace_flags)
{
- struct process_info *proc = find_process_pid (pid_of (thread));
+ process_info *proc = find_process_pid (thread->id.pid ());
int options = linux_low_ptrace_options (proc->attached);
linux_enable_event_reporting (lwpid, options);
|| ptid == thread->id
/* Handle both 'pPID' and 'pPID.-1' as meaning 'all threads
of PID'. */
- || (ptid.pid () == pid_of (thread)
+ || (ptid.pid () == thread->id.pid ()
&& (ptid.is_pid ()
|| ptid.lwp () == -1)))
{
else
{
/* Already stopped; go ahead and set the ptrace options. */
- struct process_info *proc = find_process_pid (pid_of (thread));
+ process_info *proc = find_process_pid (thread->id.pid ());
int options = linux_low_ptrace_options (proc->attached);
linux_enable_event_reporting (thread->id.lwp (), options);
struct regset_info *regset;
/* Determine word size and HWCAP. */
- int pid = pid_of (current_thread);
+ int pid = current_thread->id.pid ();
int wordsize = s390_get_wordsize (pid);
unsigned long hwcap = linux_get_hwcap (pid, wordsize);
if (current_thread == NULL)
return -1;
- pid = pid_of (current_thread);
+ pid = current_thread->id.pid ();
}
else
{