public inbox for gdb@sourceware.org
 help / color / mirror / Atom feed
From: Andreas Arnez <arnez@linux.vnet.ibm.com>
To: Matthew Fortune <Matthew.Fortune@imgtec.com>
Cc: "gcc\@gcc.gnu.org" <gcc@gcc.gnu.org>,
	       "gdb\@sourceware.org" <gdb@sourceware.org>,
	       Ulrich Weigand <uweigand@de.ibm.com>,
	       Maciej Rozycki	<Maciej.Rozycki@imgtec.com>
Subject: Re: [RFC] DW_OP_piece vs. DW_OP_bit_piece on a Register
Date: Thu, 11 Feb 2016 17:04:00 -0000	[thread overview]
Message-ID: <m360xvyy9e.fsf@oc1027705133.ibm.com> (raw)
In-Reply-To: <6D39441BF12EF246A7ABCE6654B023536A743373@LEMAIL01.le.imgtec.org>	(Matthew Fortune's message of "Thu, 11 Feb 2016 12:18:13 +0000")

On Thu, Feb 11 2016, Matthew Fortune wrote:

> No I think this is backwards it is the left half that shadows the next
> register and pieces are taken from the right. I've attempted a description
> below to see if it helps.
>
> I don't believe (in the MIPS case) we could unconditionally view the even
> numbered register as 64-bit or 32-bit as the shadowing onto the next
> register only exists in some hardware modes.
>
> The size of a register has to be determined from the current hardware mode
> and then the logic would be to read as much as possible from the referenced
> register and use it as the lower bits of the overall value. Then continue
> reading consecutive registers filling the next most significant bits
> until the full size of the DW_OP_piece has been read. This for MIPS
> FP registers is endian agnostic as the higher numbered register always
> has the most significant bits. For GPRs the even numbered register will
> provide either the most or least significant bits depending on endian but
> we have no reason to use this paradoxical DW_OP_piece for GPRs as they
> have compile time deterministic size.

Hm, so in the shadowed case, assuming that the DWARF consumer has loaded
the register file into a byte array via ptrace, which bytes would the
DW_OP_bit_piece offsets for FPR n correspond to?  Is it like this for
little-endian?

        FPR n            FPR n+1
  +---+---+---+---+ +---+---+---+---+
  |   |   |   |   | |   |   |   |   |
  +---+---+---+---+ +---+---+---+---+
   0   8   16  24    32  40  48  56

(In which case pieces would be taken from the left.)  Or different?  And
for big-endian?

--
Andreas

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

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-01-14 16:34 Andreas Arnez
2016-01-16 13:27 ` Joel Brobecker
2016-01-18 16:00   ` Andreas Arnez
2016-01-25 22:01 ` Matthew Fortune
2016-01-26 11:57   ` Andreas Arnez
2016-02-11 12:18     ` Matthew Fortune
2016-02-11 17:04       ` Andreas Arnez [this message]

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=m360xvyy9e.fsf@oc1027705133.ibm.com \
    --to=arnez@linux.vnet.ibm.com \
    --cc=Maciej.Rozycki@imgtec.com \
    --cc=Matthew.Fortune@imgtec.com \
    --cc=gcc@gcc.gnu.org \
    --cc=gdb@sourceware.org \
    --cc=uweigand@de.ibm.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).