From: Pedro Alves <pedro@codesourcery.com>
To: gdb-patches@sourceware.org
Cc: Tom Tromey <tromey@redhat.com>, Daniel Jacobowitz <drow@false.org>
Subject: Re: RFC: partially available registers
Date: Fri, 22 Jul 2011 21:58:00 -0000 [thread overview]
Message-ID: <201107222018.47875.pedro@codesourcery.com> (raw)
In-Reply-To: <201107222010.23822.pedro@codesourcery.com>
On Friday 22 July 2011 20:10:23, Pedro Alves wrote:
> On Friday 22 July 2011 19:55:31, Tom Tromey wrote:
> > >>>>> "Pedro" == Pedro Alves <pedro@codesourcery.com> writes:
> >
> > Pedro> Ah, that's it then. I was curious to know why were the
> > Pedro> upper parts of the ymm unavailable.
> >
> > amd64_linux_fetch_inferior_registers calls ptrace(PTRACE_GETREGSET)
> > to fetch the registers. Then it passes this to amd64_supply_xsave,
> > which calls i387_supply_xsave. This function then decodes the "XCR0"
> > flag and determines that the upper parts were not supplied by the
> > kernel; that is, we take the true branch here:
> >
> > if ((clear_bv & I386_XSTATE_AVX))
> > p = NULL;
> > else
> > p = regs;
>
> Ah, thanks. With a bit more context:
>
> case avxh:
> if ((clear_bv & I386_XSTATE_AVX))
> p = NULL;
> else
> p = XSAVE_AVXH_ADDR (tdep, regs, regnum);
> regcache_raw_supply (regcache, regnum, p);
> return;
>
> regcache_raw_supply with p=NULL means the register
> is unavailable. But before the <unavailable> stuff,
> it meant "supply the register as 0". I seem to remember
> discussing this AVX stuff with H.J., and coming to the
> conclusion that what want is really 0, but maybe not.
Found it:
<http://sourceware.org/ml/gdb-patches/2010-10/msg00268.html>
(and follow up)
> gdbserver is explicitly zeroing in this case, instead
> of returning unavailable, see
> gdbserver/i387-fp.c:i387_xsave_to_cache.
>
> What does it really mean when you have an AVX
> capable machine, but I386_XSTATE_AVX is clear?
>
> Whatever the answer, we need to fix one of native
> gdb or gdbserver for consistency.
--
Pedro Alves
next prev parent reply other threads:[~2011-07-22 19:19 UTC|newest]
Thread overview: 28+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-07-13 20:17 Tom Tromey
2011-07-14 4:24 ` Daniel Jacobowitz
2011-07-15 20:52 ` Tom Tromey
2011-07-18 4:15 ` Daniel Jacobowitz
2011-07-20 20:14 ` Pedro Alves
2011-07-20 18:49 ` Sergio Durigan Junior
2011-07-20 20:46 ` Tom Tromey
2011-07-20 20:53 ` Tom Tromey
2011-07-24 13:48 ` Mark Kettenis
2011-07-25 15:50 ` Tom Tromey
2011-07-21 5:23 ` Ulrich Weigand
2011-07-21 20:27 ` Tom Tromey
2011-07-22 13:48 ` Ulrich Weigand
2011-07-22 15:42 ` Tom Tromey
2011-07-22 14:30 ` Pedro Alves
2011-07-22 15:40 ` Tom Tromey
2011-07-22 19:10 ` Pedro Alves
2011-07-22 19:19 ` Tom Tromey
2011-07-22 19:31 ` Pedro Alves
2011-07-22 21:58 ` Pedro Alves [this message]
2011-07-22 22:20 ` Tom Tromey
2011-07-26 17:08 ` Pedro Alves
2011-07-26 17:13 ` Pedro Alves
2011-07-26 19:46 ` Tom Tromey
2011-07-27 18:25 ` Tom Tromey
2011-07-27 19:30 ` Tom Tromey
2011-07-27 19:33 ` Pedro Alves
2011-07-28 5:19 ` Mark Kettenis
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=201107222018.47875.pedro@codesourcery.com \
--to=pedro@codesourcery.com \
--cc=drow@false.org \
--cc=gdb-patches@sourceware.org \
--cc=tromey@redhat.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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).