Re: [PATCH] x86-64: fix ZMM register state tracking

Jan Beulich
2018-09-10T06:25:12Z

>>> Simon Marchi <simon.marchi@ericsson.com> 09/08/18 1:13 AM >>>
>Would it be possible to update or create a test to exercise that?
>arch-specific tests are in testsuite/gdb.arch.

I'm sure it would be possible, but while I was happy to invest the time to
fix the actual bug (because it affects work I'm doing), I'm afraid I don't have
the time to learn how gdb test cases are to be constructed (I'm familiar
only with the binutils / gas side of things).

>On 2018-09-05 02:22 PM, Jan Beulich wrote:
>> --- a/gdb/i387-tdep.c
>> +++ b/gdb/i387-tdep.c
>> @@ -923,7 +923,8 @@ i387_supply_xsave (struct regcache *regc
>> enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
>> struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
>> const gdb_byte *regs = (const gdb_byte *) xsave;
>> - int i;
>> + int i, zmm_endlo_regnum = I387_ZMM0H_REGNUM (tdep)
>> + + std::min (tdep->num_zmm_regs, 16);
>
>The GNU standard requires to parenthesis when breaking lines:
>
>int i, zmm_endlo_regnum = (I387_ZMM0H_REGNUM (tdep)
>+ std::min (tdep->num_zmm_regs, 16));

This is easy enough to fix (perhaps even without the need to send a v2,
but just before/while committing?); I don't think this is a rule being
enforced on the binutils side, so I simply wasn't aware.

Jan