This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH 2/2] Involve gdbarch in taking DWARF register pieces


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]