diff options
author | Gary Benson <gbenson@redhat.com> | 2015-03-24 14:05:44 +0000 |
---|---|---|
committer | Gary Benson <gbenson@redhat.com> | 2015-03-24 14:05:44 +0000 |
commit | cff068da9d13bc9fa8c04f42151b4e92bfff86a1 (patch) | |
tree | 2ee887d82766e10895cfe26b13674754e1e8fe52 /gdb/nat/linux-nat.h | |
parent | b2f7c7e8b7046bf3dd99e3fb7329feb962a6bc7d (diff) | |
download | gdb-cff068da9d13bc9fa8c04f42151b4e92bfff86a1.zip gdb-cff068da9d13bc9fa8c04f42151b4e92bfff86a1.tar.gz gdb-cff068da9d13bc9fa8c04f42151b4e92bfff86a1.tar.bz2 |
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.
Diffstat (limited to 'gdb/nat/linux-nat.h')
-rw-r--r-- | gdb/nat/linux-nat.h | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/gdb/nat/linux-nat.h b/gdb/nat/linux-nat.h index c983025..51d9ead 100644 --- a/gdb/nat/linux-nat.h +++ b/gdb/nat/linux-nat.h @@ -47,6 +47,20 @@ extern struct lwp_info *iterate_over_lwps (ptid_t filter, iterate_over_lwps_ftype callback, void *data); +/* Return the ptid of LWP. */ + +extern ptid_t ptid_of_lwp (struct lwp_info *lwp); + +/* Return nonzero if LWP is stopped, zero otherwise. This function + must be provided by the client. */ + +extern int lwp_is_stopped (struct lwp_info *lwp); + +/* Return the reason the LWP last stopped. This function must be + provided by the client. */ + +extern enum target_stop_reason lwp_stop_reason (struct lwp_info *lwp); + /* Cause LWP to stop. This function must be provided by the client. */ |