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 3/8] [PowerPC] Disable regsets using zero sizes in gdbserver


Pedro Franco de Carvalho wrote:

> gdb/gdbserver/ChangeLog:
> yyyy-mm-dd  Pedro Franco de Carvalho  <pedromfc@linux.vnet.ibm.com>
> 
> 	* linux-ppc-low.c (ppc_fill_vsxregset): Remove ppc_hwcap check.
> 	(ppc_store_vsxregset): Likewise.
> 	(ppc_fill_vrregset): Likewise.
> 	(ppc_store_vrregset): Likewise.
> 	(ppc_fill_evrregset): Likewise.
> 	(ppc_store_evrregset): Likewise.
> 	(ppc_regsets): Set VSX/VR/EVR regset sizes to 0.
> 	(ppc_arch_setup): Iterate through ppc_regsets and set sizes when
> 	needed.


> +  for (regset = ppc_regsets; regset->size >= 0; regset++)
> +    switch (regset->get_request)
> +      {
> +      case PTRACE_GETVRREGS:
> +	regset->size = features.altivec ? SIZEOF_VRREGS : 0;
> +	break;
> +      case PTRACE_GETVSXREGS:
> +	regset->size = features.vsx ? SIZEOF_VSXREGS : 0;
> +	break;
> +      case PTRACE_GETEVRREGS:
> +	if (ppc_hwcap & PPC_FEATURE_HAS_SPE)
> +	  regset->size = 32 * 4 + 8 + 4;

This should also zero out the size if the feature is not available,
just like the other cases.  Otherwise, 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]