This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PING][PATCH 2/2] Involve gdbarch in taking DWARF register pieces
- From: Andreas Arnez <arnez at linux dot vnet dot ibm dot com>
- To: Pedro Alves <palves at redhat dot com>
- Cc: Ulrich Weigand <uweigand at de dot ibm dot com>, gdb-patches at sourceware dot org
- Date: Thu, 28 Apr 2016 18:51:27 +0200
- Subject: Re: [PING][PATCH 2/2] Involve gdbarch in taking DWARF register pieces
- Authentication-results: sourceware.org; auth=none
- References: <20160415180943 dot 4FEE857EE at oc7340732750 dot ibm dot com> <571134CD dot 8080507 at redhat dot com> <m3shyjw2t3 dot fsf at oc1027705133 dot ibm dot com> <5714E6EA dot 8050905 at redhat dot com> <m3lh4bvu2z dot fsf at oc1027705133 dot ibm dot com> <57150356 dot 3090508 at redhat dot com> <m3a8kpx0ls dot fsf at oc1027705133 dot ibm dot com> <m3h9elvpc7 dot fsf_-_ at oc1027705133 dot ibm dot com> <ee0690e4-1228-7479-61cb-82366f643801 at redhat dot com>
On Thu, Apr 28 2016, Pedro Alves wrote:
> I couldn't find any reference to "sub-register" in the codebase.
> I'd assume it's something like "eax" being a sub part of "rax"
> on x86-64. But I'm not certain that's the case here? On a machine with
> vector registers, is a FP register really a chunk of the vector
> register, or is it a real separate physical register?
It's exactly comparable with eax and rax. Or consider the SSE registers
xmm0-xmm15, which are embedded in their double-wide AVX counterparts
ymm0-ymm15. With z/Architecture, each 64-bit FP register is just a
"chunk" ("sub-register" / "part" / "slice" / ...) of a 128-bit vector
register. The ASCII art in section 2.1 of this article illustrates
this:
https://sourceware.org/ml/gdb/2016-01/msg00013.html
(BTW, I still didn't get much feedback on that article...)
And if there is a better (or wider used) term than "sub-register", I'll
be happy to change the wording.
> My main confusion revolves I think, around how these points
> are addressed:
>
> - FP registers and vector registers have the same identical
> DWARF register number.
>
> - If the object stored is <= 8 bytes, we should find it in
> the FP register; otherwise get it from the vector register.
>
> I'd naively think that the fix for something like that would be
> to make dwarf_reg_to_regnum return the gdb FP register number instead
> of the vector number, when the type fits in a FP register, instead of
> the need for an extra diversion step. Ignoring the fact that we don't
> currently pass the type/size to gdbarch_dwarf_reg_to_regnum.
Right, ignoring that fact ;-)
Also, IMHO the "actual" placement of an object within a register does
not conceptually depend on where the register number came from. It
could come from DWARF, from some other debug format, from the user, or
from wherever. Adjusting the placement only for objects with a DWARF
location seems wrong to me.
--
Andreas