mirror of
https://github.com/bminor/binutils-gdb.git
synced 2025-12-24 16:27:27 +00:00
Introduce basic LWP accessors
This commit introduces three accessors that shared Linux code can use to access fields of struct lwp_info. The GDB and gdbserver Linux x86 code is modified to use them. gdb/ChangeLog: * nat/linux-nat.h (ptid_of_lwp): New declaration. (lwp_is_stopped): Likewise. (lwp_stop_reason): Likewise. * linux-nat.c (ptid_of_lwp): New function. (lwp_is_stopped): Likewise. (lwp_is_stopped_by_watchpoint): Likewise. * x86-linux-nat.c (update_debug_registers_callback): Use lwp_is_stopped. (x86_linux_prepare_to_resume): Use ptid_of_lwp and lwp_stop_reason. gdb/gdbserver/ChangeLog: * linux-low.c (ptid_of_lwp): New function. (lwp_is_stopped): Likewise. (lwp_stop_reason): Likewise. * linux-x86-low.c (update_debug_registers_callback): Use lwp_is_stopped. (x86_linux_prepare_to_resume): Use ptid_of_lwp and lwp_stop_reason.
This commit is contained in:
@@ -281,6 +281,33 @@ static int check_stopped_by_breakpoint (struct lwp_info *lp);
|
||||
static int sigtrap_is_event (int status);
|
||||
static int (*linux_nat_status_is_event) (int status) = sigtrap_is_event;
|
||||
|
||||
|
||||
/* LWP accessors. */
|
||||
|
||||
/* See nat/linux-nat.h. */
|
||||
|
||||
ptid_t
|
||||
ptid_of_lwp (struct lwp_info *lwp)
|
||||
{
|
||||
return lwp->ptid;
|
||||
}
|
||||
|
||||
/* See nat/linux-nat.h. */
|
||||
|
||||
int
|
||||
lwp_is_stopped (struct lwp_info *lwp)
|
||||
{
|
||||
return lwp->stopped;
|
||||
}
|
||||
|
||||
/* See nat/linux-nat.h. */
|
||||
|
||||
enum target_stop_reason
|
||||
lwp_stop_reason (struct lwp_info *lwp)
|
||||
{
|
||||
return lwp->stop_reason;
|
||||
}
|
||||
|
||||
|
||||
/* Trivial list manipulation functions to keep track of a list of
|
||||
new stopped processes. */
|
||||
|
||||
Reference in New Issue
Block a user