diff options
author | Marcus Shawcroft <mshawcroft@sourceware.org> | 2013-02-07 10:47:40 +0000 |
---|---|---|
committer | Marcus Shawcroft <mshawcroft@sourceware.org> | 2013-02-07 10:47:40 +0000 |
commit | 55fac6e0501298d3140968078e31a1b1a85bd4d0 (patch) | |
tree | 79f8c8c3f963dcb9332a86a4a8a83b57ffebf833 | |
parent | 0f5f799a26ee1ab0e591247bb54827a9010bd7b9 (diff) | |
download | gdb-55fac6e0501298d3140968078e31a1b1a85bd4d0.zip gdb-55fac6e0501298d3140968078e31a1b1a85bd4d0.tar.gz gdb-55fac6e0501298d3140968078e31a1b1a85bd4d0.tar.bz2 |
Switch AArch64 gdbserver ps_get_thread_area to PTRACE_GETREGSET.
2013-02-06 Marcus Shawcroft <marcus.shawcroft@arm.com>
* linux-aarch64-low.c (ps_get_thread_area): Replace
PTRACE_GET_THREAD_AREA with PTRACE_GETREGSET.
-rw-r--r-- | gdb/gdbserver/ChangeLog | 5 | ||||
-rw-r--r-- | gdb/gdbserver/linux-aarch64-low.c | 12 |
2 files changed, 14 insertions, 3 deletions
diff --git a/gdb/gdbserver/ChangeLog b/gdb/gdbserver/ChangeLog index 4de39a2..f26620b 100644 --- a/gdb/gdbserver/ChangeLog +++ b/gdb/gdbserver/ChangeLog @@ -1,3 +1,8 @@ +2013-02-07 Marcus Shawcroft <marcus.shawcroft@arm.com> + + * linux-aarch64-low.c (ps_get_thread_area): Replace + PTRACE_GET_THREAD_AREA with PTRACE_GETREGSET. + 2013-02-04 Jim MacArthur <jim.macarthur@arm.com> Marcus Shawcroft <marcus.shawcroft@arm.com> Nigel Stephens <nigel.stephens@arm.com> diff --git a/gdb/gdbserver/linux-aarch64-low.c b/gdb/gdbserver/linux-aarch64-low.c index 7f99887..883277c 100644 --- a/gdb/gdbserver/linux-aarch64-low.c +++ b/gdb/gdbserver/linux-aarch64-low.c @@ -1089,16 +1089,22 @@ aarch64_stopped_by_watchpoint (void) /* Fetch the thread-local storage pointer for libthread_db. */ ps_err_e -ps_get_thread_area (const struct ps_prochandle * ph, +ps_get_thread_area (const struct ps_prochandle *ph, lwpid_t lwpid, int idx, void **base) { - if (ptrace (PTRACE_GET_THREAD_AREA, lwpid, NULL, base) != 0) + struct iovec iovec; + uint64_t reg; + + iovec.iov_base = ® + iovec.iov_len = sizeof (reg); + + if (ptrace (PTRACE_GETREGSET, lwpid, NT_ARM_TLS, &iovec) != 0) return PS_ERR; /* IDX is the bias from the thread pointer to the beginning of the thread descriptor. It has to be subtracted due to implementation quirks in libthread_db. */ - *base = (void *) ((char *) *base - idx); + *base = (void *) (reg - idx); return PS_OK; } |