diff options
author | Gary Benson <gbenson@redhat.com> | 2015-03-24 14:05:43 +0000 |
---|---|---|
committer | Gary Benson <gbenson@redhat.com> | 2015-03-24 14:05:43 +0000 |
commit | 7b6690874fa3a8afacd731b70a461d55a5b1311c (patch) | |
tree | 9812e8a6063beb1c5a99a5524879d78f291f69dc /gdb/nat/linux-nat.h | |
parent | 15630549010233e9d0f0b1971d27e121cd74bdd0 (diff) | |
download | gdb-7b6690874fa3a8afacd731b70a461d55a5b1311c.zip gdb-7b6690874fa3a8afacd731b70a461d55a5b1311c.tar.gz gdb-7b6690874fa3a8afacd731b70a461d55a5b1311c.tar.bz2 |
Introduce current_lwp_ptid
This commit introduces a new function, current_lwp_ptid, that
shared Linux code can use to obtain the ptid of the current
lightweight process.
gdb/ChangeLog:
* nat/linux-nat.h (current_lwp_ptid): New declaration.
* linux-nat.c (current_lwp_ptid): New function.
* x86-linux-nat.c: Include nat/linux-nat.h.
(x86_linux_dr_get_addr): Use current_lwp_ptid.
(x86_linux_dr_get_control): Likewise.
(x86_linux_dr_get_status): Likewise.
(x86_linux_dr_set_control): Likewise.
(x86_linux_dr_set_addr): Likewise.
gdb/gdbserver/ChangeLog:
* linux-low.c (current_lwp_ptid): New function.
* linux-x86-low.c: Include nat/linux-nat.h.
(x86_dr_low_get_addr): Use current_lwp_ptid.
(x86_dr_low_get_control): Likewise.
(x86_dr_low_get_status): Likewise.
Diffstat (limited to 'gdb/nat/linux-nat.h')
-rw-r--r-- | gdb/nat/linux-nat.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/gdb/nat/linux-nat.h b/gdb/nat/linux-nat.h index dc81b5d..c06f72d 100644 --- a/gdb/nat/linux-nat.h +++ b/gdb/nat/linux-nat.h @@ -25,4 +25,11 @@ instead SIGTRAP with bit 7 set. */ #define SYSCALL_SIGTRAP (SIGTRAP | 0x80) +/* Return the ptid of the current lightweight process. With NPTL + threads and LWPs map 1:1, so this is equivalent to returning the + ptid of the current thread. This function must be provided by + the client. */ + +extern ptid_t current_lwp_ptid (void); + #endif /* LINUX_NAT_H */ |