16 Jun 2012 19:41
PATCH: Use PTRACE_PEEKUSER to get fs_base and gs_base for x32
H.J. Lu <hongjiu.lu <at> intel.com>
2012-06-16 17:41:48 GMT
2012-06-16 17:41:48 GMT
PTRACE_ARCH_PRCTL is obsolete since 2.6.25, where the fs_base and gs_base
fields of user_regs_struct can be used directly. Since x32 support was
added to kernel 3.4.0 and PTRACE_ARCH_PRCTL support was removed for x32,
we should always use fs_base/gs_base for x32. It uses fs_base and gs_base
only if __ILP32__ is defined since they aren't available with the older
header files. OK to install?
Thanks.
H.J.
---
2012-06-16 Roland McGrath <roland <at> hack.frob.com>
H.J. Lu <hongjiu.lu <at> intel.com>
* amd64-linux-nat.c (ps_get_thread_area): Use PTRACE_PEEKUSER
to get fs_base and gs_base for x32.
diff --git a/gdb/amd64-linux-nat.c b/gdb/amd64-linux-nat.c
index 23eadbd..7a90065 100644
--- a/gdb/amd64-linux-nat.c
+++ b/gdb/amd64-linux-nat.c
<at> <at> -479,12 +479,45 <at> <at> ps_get_thread_area (const struct ps_prochandle *ph,
switch (idx)
{
case FS:
+#ifdef __ILP32__
+ {
+ /* PTRACE_ARCH_PRCTL is obsolete since 2.6.25, where the
+ fs_base and gs_base fields of user_regs_struct can be
+ used directly. Since x32 support was added to kernel
(Continue reading)
RSS Feed