Re: [RFC] Add support for PPC Altivec registers in gcore

Ulrich Weigand
2007-10-30T21:02:56Z

Carlos Eduardo Seo wrote:

> About the new gdbarch variable, do you think it's a good idea to
> introduce it now, only with .reg-ppc-vmx and .reg-xfp on the list, or
> you'd rather do a full rework later in GDB in order to remove all
> fill_ fallbacks make linux-nat/corelow code get everything from there?

Completely removing all the fallbacks seems quite a bit of work;
if you want to work on it that would certainly be welcome.

However, I think it would be OK to start with having the gdbarch
variable only contain the *extra* register sets, beyond the core
and floating-point sets.

> + if (core_regset_p
> + && (regset = gdbarch_regset_from_core_section (gdbarch, ".reg-ppc-vmx",
> + sizeof (vrregs))) != NULL
> + && regset->collect_regset != NULL)
> + regset->collect_regset (regset, regcache, -1,
> + &vrregs, sizeof (vrregs));
> +
> + note_data = (char *) elfcore_write_ppc_vmx (obfd,
> + note_data,
> + note_size,
> + &vrregs, sizeof (vrregs));

If we do not have a collect_regset, we certainly do not want to
write an note section containing uninitialized data. The
elfcore_write_ppc_vmx call needs to be inside the "if" block ...

> -static void
> +void
> fill_vrregset (const struct regcache *regcache, gdb_vrregset_t *vrregsetp)

This is no longer necessary now.

Bye,
Ulrich

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