Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Yao Qi <qiyaoltc@gmail.com>
To: Kees Cook <keescook@chromium.org>
Cc: "gdb-patches@sourceware.org" <gdb-patches@sourceware.org>,
	Brian Murray <brian.murray@canonical.com>,
		Matthias Klose <matthias.klose@canonical.com>
Subject: Re: [PATCH] Fix PTRACE_GETREGSET failure for compat inferiors on arm64
Date: Sun, 04 Dec 2016 11:11:00 -0000	[thread overview]
Message-ID: <CAH=s-PMKO55qJDUvBjfdO+0Fve4Z1ESY9PdGYYYNh7OoYMPF7A@mail.gmail.com> (raw)
In-Reply-To: <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 (齐尧)


  reply	other threads:[~2016-12-04 11:11 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-12-02 21:46 Kees Cook
2016-12-02 22:49 ` Yao Qi
2016-12-02 23:08   ` Kees Cook
2016-12-04 11:11     ` Yao Qi [this message]
2016-12-04 19:30       ` Kees Cook
2016-12-05 10:26         ` Yao Qi
2016-12-05 16:06           ` Kees Cook
2016-12-09  9:27             ` Yao Qi
2016-12-02 23:50   ` Doug Evans
2016-12-04 10:31     ` Yao Qi

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAH=s-PMKO55qJDUvBjfdO+0Fve4Z1ESY9PdGYYYNh7OoYMPF7A@mail.gmail.com' \
    --to=qiyaoltc@gmail.com \
    --cc=brian.murray@canonical.com \
    --cc=gdb-patches@sourceware.org \
    --cc=keescook@chromium.org \
    --cc=matthias.klose@canonical.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox