This is the mail archive of the
gdb@sourceware.org
mailing list for the GDB project.
Re: [RFC] DW_OP_piece vs. DW_OP_bit_piece on a Register
- From: Andreas Arnez <arnez at linux dot vnet dot ibm dot com>
- To: Matthew Fortune <Matthew dot Fortune at imgtec dot com>
- Cc: "gcc\ at gcc dot gnu dot org" <gcc at gcc dot gnu dot org>, "gdb\ at sourceware dot org" <gdb at sourceware dot org>, Ulrich Weigand <uweigand at de dot ibm dot com>, Maciej Rozycki <Maciej dot Rozycki at imgtec dot com>
- Date: Thu, 11 Feb 2016 18:04:13 +0100
- Subject: Re: [RFC] DW_OP_piece vs. DW_OP_bit_piece on a Register
- Authentication-results: sourceware.org; auth=none
- References: <m3vb6wm86q dot fsf at oc1027705133 dot ibm dot com> <6D39441BF12EF246A7ABCE6654B023536A70637C at LEMAIL01 dot le dot imgtec dot org> <m31t94ft98 dot fsf at oc1027705133 dot ibm dot com> <6D39441BF12EF246A7ABCE6654B023536A743373 at LEMAIL01 dot le dot imgtec dot org>
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