This is the mail archive of the gdb-cvs@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]

[binutils-gdb] Use regcache->tdesc instead of arm_hwcap


https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=89abb03951a90203c6635296447b7e96a1248a68

commit 89abb03951a90203c6635296447b7e96a1248a68
Author: Yao Qi <yao.qi@linaro.org>
Date:   Thu Jul 30 15:07:39 2015 +0100

    Use regcache->tdesc instead of arm_hwcap
    
    arm_hwcap is a global variable, and we should avoid using it as much
    as we can.  Instead of checking arm_hwcap, we can check whether
    regcache->tdesc is a certain kind of target description.  This is
    what this patch does.
    
    gdb/gdbserver:
    
    2015-07-30  Yao Qi  <yao.qi@linaro.org>
    
    	* linux-arm-low.c (arm_fill_wmmxregset): Don't use arm_hwcap.
    	Use regcache->tdesc instead.
    	(arm_store_wmmxregset): Likewise.
    	(arm_fill_vfpregset): Likewise.
    	(arm_store_vfpregset): Likewise.

Diff:
---
 gdb/gdbserver/ChangeLog       |  8 ++++++++
 gdb/gdbserver/linux-arm-low.c | 24 ++++++++++++------------
 2 files changed, 20 insertions(+), 12 deletions(-)

diff --git a/gdb/gdbserver/ChangeLog b/gdb/gdbserver/ChangeLog
index a3c0a2a..630335c 100644
--- a/gdb/gdbserver/ChangeLog
+++ b/gdb/gdbserver/ChangeLog
@@ -1,5 +1,13 @@
 2015-07-30  Yao Qi  <yao.qi@linaro.org>
 
+	* linux-arm-low.c (arm_fill_wmmxregset): Don't use arm_hwcap.
+	Use regcache->tdesc instead.
+	(arm_store_wmmxregset): Likewise.
+	(arm_fill_vfpregset): Likewise.
+	(arm_store_vfpregset): Likewise.
+
+2015-07-30  Yao Qi  <yao.qi@linaro.org>
+
 	* linux-arm-low.c: Include arch/arm.h.
 	(arm_fill_gregset): Don't use arm_num_regs and arm_regmap.
 	(arm_store_gregset): Likewise.
diff --git a/gdb/gdbserver/linux-arm-low.c b/gdb/gdbserver/linux-arm-low.c
index 0a34379..02a1c08 100644
--- a/gdb/gdbserver/linux-arm-low.c
+++ b/gdb/gdbserver/linux-arm-low.c
@@ -185,7 +185,7 @@ arm_fill_wmmxregset (struct regcache *regcache, void *buf)
 {
   int i;
 
-  if (!(arm_hwcap & HWCAP_IWMMXT))
+  if (regcache->tdesc != tdesc_arm_with_iwmmxt)
     return;
 
   for (i = 0; i < 16; i++)
@@ -202,7 +202,7 @@ arm_store_wmmxregset (struct regcache *regcache, const void *buf)
 {
   int i;
 
-  if (!(arm_hwcap & HWCAP_IWMMXT))
+  if (regcache->tdesc != tdesc_arm_with_iwmmxt)
     return;
 
   for (i = 0; i < 16; i++)
@@ -219,13 +219,13 @@ arm_fill_vfpregset (struct regcache *regcache, void *buf)
 {
   int i, num, base;
 
-  if (!(arm_hwcap & HWCAP_VFP))
-    return;
-
-  if ((arm_hwcap & (HWCAP_VFPv3 | HWCAP_VFPv3D16)) == HWCAP_VFPv3)
+  if (regcache->tdesc == tdesc_arm_with_neon
+      || regcache->tdesc == tdesc_arm_with_vfpv3)
     num = 32;
-  else
+  else if (regcache->tdesc == tdesc_arm_with_vfpv2)
     num = 16;
+  else
+    return;
 
   base = find_regno (regcache->tdesc, "d0");
   for (i = 0; i < num; i++)
@@ -239,13 +239,13 @@ arm_store_vfpregset (struct regcache *regcache, const void *buf)
 {
   int i, num, base;
 
-  if (!(arm_hwcap & HWCAP_VFP))
-    return;
-
-  if ((arm_hwcap & (HWCAP_VFPv3 | HWCAP_VFPv3D16)) == HWCAP_VFPv3)
+  if (regcache->tdesc == tdesc_arm_with_neon
+      || regcache->tdesc == tdesc_arm_with_vfpv3)
     num = 32;
-  else
+  else if (regcache->tdesc == tdesc_arm_with_vfpv2)
     num = 16;
+  else
+    return;
 
   base = find_regno (regcache->tdesc, "d0");
   for (i = 0; i < num; i++)


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]