This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] Fix PTRACE_GETREGSET failure for compat inferiors on arm64


On Sun, Dec 4, 2016 at 3:11 AM, Yao Qi <qiyaoltc@gmail.com> wrote:
> 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.

Right, I was asking how the target description is built. I couldn't
determine where FPA was detected.

-Kees

-- 
Kees Cook
Nexus Security


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]