This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH] Fix PTRACE_GETREGSET failure for compat inferiors on arm64
- From: Yao Qi <qiyaoltc at gmail dot com>
- To: Kees Cook <keescook at chromium dot org>
- Cc: "gdb-patches at sourceware dot org" <gdb-patches at sourceware dot org>, Brian Murray <brian dot murray at canonical dot com>, Matthias Klose <matthias dot klose at canonical dot com>
- Date: Sun, 4 Dec 2016 11:11:18 +0000
- Subject: Re: [PATCH] Fix PTRACE_GETREGSET failure for compat inferiors on arm64
- Authentication-results: sourceware.org; auth=none
- References: <20161202214613.GA54717@beast> <20161202224952.panaxwmmrx4emord@localhost> <CAGXu5jLGWLrvJCQXqRxcoi2=rz1nxXY9oZGUDwxrRnVrSkscrQ@mail.gmail.com>
On Fri, Dec 2, 2016 at 11:08 PM, Kees Cook <keescook@chromium.org> wrote:
>>> diff --git a/gdb/arm-linux-nat.c b/gdb/arm-linux-nat.c
>>> index d11bdc6..2126cd7 100644
>>> --- a/gdb/arm-linux-nat.c
>>> +++ b/gdb/arm-linux-nat.c
>>> @@ -384,17 +384,19 @@ arm_linux_fetch_inferior_registers (struct target_ops *ops,
>>> if (-1 == regno)
>>> {
>>> fetch_regs (regcache);
>>> - fetch_fpregs (regcache);
>>
>> We should only call fetch_fpregs if tdep->have_fpa_registers is true.
>
> I couldn't determine how this was handled. What actually sets
> org.gnu.gdb.arm.fpa in tdesc? I found gdb/features/arm/arm-fpa.xml and
> seems to imply it's always included with arm? I wasn't able to follow,
> but it seemed like _having_ VFP was a indicator that FPA wasn't used.
>
What is I meant is that instead of calling fetch_fpregs unconditionally,
we call fetch_fpregs if tdep->have_fpa_registers is true, like this,
if (tdep->have_fpa_registers)
fetch_fpregs (regcache);
IOW, we only fetch FPA registers if we know FPA registers are available,
as described in target description.
--
Yao (齐尧)