}) != NULL;
}
-struct process_info *
-get_thread_process (const struct thread_info *thread)
-{
- return find_process_pid (thread->id.pid ());
-}
-
struct process_info *
current_process (void)
{
switch_to_thread (thread_info *thread)
{
if (thread != nullptr)
- current_process_ = get_thread_process (thread);
+ current_process_ = thread->process ();
else
current_process_ = nullptr;
current_thread = thread;
is null. */
struct process_info *current_process (void);
-struct process_info *get_thread_process (const struct thread_info *);
extern owning_intrusive_list<process_info> all_processes;
the client side will access registers. */
gdb_assert (child_proc != NULL);
- process_info *parent_proc = get_thread_process (event_thr);
+ process_info *parent_proc = event_thr->process ();
child_proc->attached = parent_proc->attached;
clone_all_breakpoints (child_thr, event_thr);
}
else if (event == PTRACE_EVENT_EXEC && cs.report_exec_events)
{
- struct process_info *proc;
std::vector<int> syscalls_to_catch;
ptid_t event_ptid;
pid_t event_pid;
event_pid = event_ptid.pid ();
/* Save the syscall list from the execing process. */
- proc = get_thread_process (event_thr);
+ process_info *proc = event_thr->process ();
syscalls_to_catch = std::move (proc->syscalls_to_catch);
/* Delete the execing process and all its threads. */
CORE_ADDR
linux_process_target::get_pc (lwp_info *lwp)
{
- process_info *proc = get_thread_process (get_lwp_thread (lwp));
+ process_info *proc = get_lwp_thread (lwp)->process ();
gdb_assert (!proc->starting_up);
if (!low_supports_breakpoints ())
if (!low_supports_breakpoints ())
return false;
- process_info *proc = get_thread_process (get_lwp_thread (lwp));
+ process_info *proc = get_lwp_thread (lwp)->process ();
if (proc->starting_up)
{
/* Claim we have the stop PC so that the caller doesn't try to
static int
gdb_catching_syscalls_p (struct lwp_info *event_child)
{
- struct thread_info *thread = get_lwp_thread (event_child);
- struct process_info *proc = get_thread_process (thread);
-
- return !proc->syscalls_to_catch.empty ();
+ return !get_lwp_thread (event_child)->process ()->syscalls_to_catch.empty ();
}
bool
{
int sysno;
struct thread_info *thread = get_lwp_thread (event_child);
- struct process_info *proc = get_thread_process (thread);
+ process_info *proc = thread->process ();
if (proc->syscalls_to_catch.empty ())
return false;
{
struct thread_info *thread = get_lwp_thread (lwp);
int ptrace_request;
- struct process_info *proc = get_thread_process (thread);
/* Note that target description may not be initialised
(proc->tdesc == NULL) at this point because the program hasn't
step = single_step (lwp);
}
- if (proc->tdesc != NULL && low_supports_breakpoints ())
+ if (thread->process ()->tdesc != nullptr && low_supports_breakpoints ())
{
struct regcache *regcache = get_thread_regcache (current_thread, 1);
{
struct lwp_info *lwp = get_thread_lwp (thread);
CORE_ADDR pc;
- struct process_info *proc = get_thread_process (thread);
/* GDBserver is skipping the extra traps from the wrapper program,
don't have to do step over. */
- if (proc->tdesc == NULL)
+ if (thread->process ()->tdesc == nullptr)
return false;
/* LWPs which will not be resumed are not interesting, because we
void
delete_single_step_breakpoints (struct thread_info *thread)
{
- struct process_info *proc = get_thread_process (thread);
+ process_info *proc = thread->process ();
struct breakpoint *bp, **bp_link;
bp = proc->breakpoints;
void
uninsert_single_step_breakpoints (struct thread_info *thread)
{
- struct process_info *proc = get_thread_process (thread);
+ process_info *proc = thread->process ();
struct breakpoint *bp;
for (bp = proc->breakpoints; bp != NULL; bp = bp->next)
int
has_single_step_breakpoints (struct thread_info *thread)
{
- struct process_info *proc = get_thread_process (thread);
+ process_info *proc = thread->process ();
struct breakpoint *bp, **bp_link;
bp = proc->breakpoints;
void
reinsert_single_step_breakpoints (struct thread_info *thread)
{
- struct process_info *proc = get_thread_process (thread);
+ process_info *proc = thread->process ();
struct breakpoint *bp;
for (bp = proc->breakpoints; bp != NULL; bp = bp->next)
struct breakpoint *new_bkpt;
struct breakpoint *bkpt_tail = NULL;
struct raw_breakpoint *raw_bkpt_tail = NULL;
- struct process_info *child_proc = get_thread_process (child_thread);
- struct process_info *parent_proc = get_thread_process (parent_thread);
+ process_info *child_proc = child_thread->process ();
+ process_info *parent_proc = parent_thread->process ();
struct breakpoint **new_list = &child_proc->breakpoints;
struct raw_breakpoint **new_raw_list = &child_proc->raw_breakpoints;
have. */
if (regcache == NULL)
{
- struct process_info *proc = get_thread_process (thread);
+ process_info *proc = thread->process ();
gdb_assert (proc->tdesc != NULL);
process = find_process_pid (pid);
}
else
- {
- process = (current_thread != nullptr
- ? get_thread_process (current_thread)
- : nullptr);
- }
+ process = current_process ();
if (process == NULL)
{
if (child == nullptr || kind == TARGET_WAITKIND_THREAD_CLONED)
continue;
- process_info *fork_child_process = get_thread_process (child);
- gdb_assert (fork_child_process != nullptr);
-
+ process_info *fork_child_process = child->process ();
int fork_child_pid = fork_child_process->pid;
if (detach_inferior (fork_child_process) != 0)
psaddr_t addr;
td_err_e err;
struct lwp_info *lwp;
- struct process_info *proc;
struct thread_db *thread_db;
+ process_info *proc = thread->process ();
- proc = get_thread_process (thread);
thread_db = proc->priv->thread_db;
/* If the thread layer is not (yet) initialized, fail. */
bool
thread_db_thread_handle (ptid_t ptid, gdb_byte **handle, int *handle_len)
{
- struct thread_db *thread_db;
struct lwp_info *lwp;
thread_info *thread = find_thread_ptid (ptid);
if (thread == NULL)
return false;
- thread_db = get_thread_process (thread)->priv->thread_db;
+ thread_db *thread_db = thread->process ()->priv->thread_db;
if (thread_db == NULL)
return false;
void
thread_db_notice_clone (struct thread_info *parent_thr, ptid_t child_ptid)
{
- process_info *parent_proc = get_thread_process (parent_thr);
- struct thread_db *thread_db = parent_proc->priv->thread_db;
+ thread_db *thread_db = parent_thr->process ()->priv->thread_db;
/* If the thread layer isn't initialized, return. It may just
be that the program uses clone, but does not use libthread_db. */