This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH 2/2] Involve gdbarch in taking DWARF register pieces
- From: "Ulrich Weigand" <uweigand at de dot ibm dot com>
- To: arnez at linux dot vnet dot ibm dot com (Andreas Arnez)
- Cc: gdb-patches at sourceware dot org, Ulrich dot Weigand at de dot ibm dot com (Ulrich Weigand)
- Date: Fri, 15 Apr 2016 20:09:43 +0200 (CEST)
- Subject: Re: [PATCH 2/2] Involve gdbarch in taking DWARF register pieces
- Authentication-results: sourceware.org; auth=none
Andreas Arnez wrote:
> On s390, when a 'long double' variable is located in a pair of FP
> registers, its DWARF location looks something like this:
>
> DW_OP_reg24 (f8); DW_OP_piece: 8; DW_OP_reg25 (f10); DW_OP_piece: 8
>
> If the target has a vector facility, each of its FP registers is
> embedded left-aligned in a vector register with the same identical DWARF
> register number. But GDB always takes a register piece from the "least
> significant" end, which is exactly opposite from where the FP register
> is embedded. This mismatch causes a regression with store.exp.
>
> This change fixes this issue by taking s390 vector register pieces from
> the left end instead. Since this requires a suitable gdbarch interface,
> the gdbarch method 'value_from_register' is replaced by a new method
> 'register_part' with similar functionality, but a slightly different
> interface. This method is then invoked in read_pieced_value and
> write_pieced_value.
I agree it makes sense to use the same gdbarch-provided information
in both places here.
> gdb/ChangeLog:
>
> * gdbarch.sh (value_from_register): Remove.
> (register_part): New.
> * gdbarch.c: Regenerate.
> * gdbarch.h: Likewise.
> * dwarf2loc.c (read_pieced_value): Get arch-specific placement of
> a register piece from the new gdbarch method register_part.
> (write_pieced_value): Likewise.
> * value.h (default_value_from_register): Remove.
> (default_register_part): Declare.
> * findvar.c (default_value_from_register): Remove.
> (default_register_part): New.
> (value_from_register): Call gdbarch_register_part instead of
> gdbarch_value_from_register.
> (address_from_register): Likewise.
> * s390-linux-tdep.c (s390_value_from_register): Remove.
> (s390_register_part): New.
> (s390_gdbarch_init): Set new gdbarch method register_part instead
> of value_from_register.
> * spu-tdep.c (spu_value_from_register): Remove.
> (spu_register_part): New.
> (spu_gdbarch_init): Set new gdbarch method register_part instead
> of value_from_register.
This is OK.
Thanks,
Ulrich
--
Dr. Ulrich Weigand
GNU/Linux compilers and toolchain
Ulrich.Weigand@de.ibm.com