Re: [patch] Add support for PPC Altivec registers in core files

Ulrich Weigand
2007-10-26T15:01:19Z

Carlos Eduardo Seo wrote:

> Thanks for reviewing this. I've attached the updated patch.

Thanks. There's still some minor issues I've pointed out below.
Patch is OK with those fixed.

> As for gcore, I'm not familiar with it. If you point out some
> directions, I could do it as well. No problem.

Have a look at linux_nat_do_thread_registers in linux-nat.c.
This would need to be extended to write the Altivec register
section where applicable. You may also need additional BFD
support for this.

Bye,
Ulrich

> + if ((regnum != tdep->ppc_vrsave_regnum)
> + && (regnum != tdep->ppc_vrsave_regnum - 1))
Still superfluous parentheses ;-)

> + ppc_supply_reg (regcache, regnum, vrregs, offset, 16);
> + else if (regnum == (tdep->ppc_vrsave_regnum - 1))
> + ppc_supply_reg (regcache, regnum,
> + vrregs, offset, 4);
> + else
> + ppc_supply_reg (regcache, regnum,
> + vrregs, offset, 4);
Now the middle "else if" is superfluous.

> + offset = ppc_vrreg_offset (tdep, offsets, regnum);
> + if ((regnum != tdep->ppc_vrsave_regnum)
> + && (regnum != tdep->ppc_vrsave_regnum - 1))
> + ppc_collect_reg (regcache, regnum, vrregs, offset, 16);
> + else if (regnum == (tdep->ppc_vrsave_regnum - 1))
> + ppc_collect_reg (regcache, regnum,
> + vrregs, offset, 4);
> + else
> + ppc_collect_reg (regcache, regnum,
> + vrregs, offset, 4);

Same applies to this part.

--
Dr. Ulrich Weigand
GNU Toolchain for Linux on System z and Cell BE
Ulrich.Weigand@de.ibm.com