Fix checks for VSX and Altivec availability on Power
authorEdjunior Barbosa Machado <emachado@linux.vnet.ibm.com>
Fri, 22 Apr 2016 22:39:12 +0000 (19:39 -0300)
committerEdjunior Barbosa Machado <emachado@linux.vnet.ibm.com>
Fri, 22 Apr 2016 22:39:12 +0000 (19:39 -0300)
gdb/ChangeLog

* ppc-linux-nat.c (ppc_linux_read_description): Use PPC_FEATURE_HAS_VSX
and PPC_FEATURE_HAS_ALTIVEC to check if such features are available.

gdb/ChangeLog
gdb/ppc-linux-nat.c

index 56f96440071bcdab6c224a6821308d1f0613f581..91db2e38cbd4717d732f8338862d8e11a768b50b 100644 (file)
@@ -1,3 +1,8 @@
+2016-04-22  Edjunior Barbosa Machado  <emachado@linux.vnet.ibm.com>
+
+       * ppc-linux-nat.c (ppc_linux_read_description): Use PPC_FEATURE_HAS_VSX
+       and PPC_FEATURE_HAS_ALTIVEC to check if such features are available.
+
 2016-04-22  Yao Qi  <yao.qi@linaro.org>
 
        * valops.c (read_value_memory): New local variable 'stack'.
index bf914626679a1eb2a18148d2161568eceab5f5e7..84c14a1ae9efdd381748e704404d84e8afb93108 100644 (file)
@@ -2419,7 +2419,8 @@ ppc_linux_read_description (struct target_ops *ops)
        perror_with_name (_("Unable to fetch SPE registers"));
     }
 
-  if (have_ptrace_getsetvsxregs)
+  if (have_ptrace_getsetvsxregs
+      && (ppc_linux_get_hwcap () & PPC_FEATURE_HAS_VSX))
     {
       gdb_vsxregset_t vsxregset;
 
@@ -2432,7 +2433,8 @@ ppc_linux_read_description (struct target_ops *ops)
        perror_with_name (_("Unable to fetch VSX registers"));
     }
 
-  if (have_ptrace_getvrregs)
+  if (have_ptrace_getvrregs
+      && (ppc_linux_get_hwcap () & PPC_FEATURE_HAS_ALTIVEC))
     {
       gdb_vrregset_t vrregset;