This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [patch] Add support for PPC Altivec registers in core files
- From: "Ulrich Weigand" <uweigand at de dot ibm dot com>
- To: cseo at linux dot vnet dot ibm dot com (Carlos Eduardo Seo)
- Cc: gdb-patches at sourceware dot org (GDB Patches Mailing List)
- Date: Fri, 26 Oct 2007 17:01:11 +0200 (CEST)
- Subject: Re: [patch] Add support for PPC Altivec registers in core files
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