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] Remove global variable arm_hwcap


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

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

    Remove global variable arm_hwcap
    
    After previous patch, we don't need global variable arm_hwcap.  This
    patch is to remove it.
    
    gdb/gdbserver:
    
    2015-07-30  Yao Qi  <yao.qi@linaro.org>
    
    	* linux-arm-low.c (arm_hwcap): Remove it.
    	(arm_read_description): New local variable arm_hwcap.  Don't
    	set arm_hwcap to zero.

Diff:
---
 gdb/gdbserver/ChangeLog       |  6 ++++++
 gdb/gdbserver/linux-arm-low.c | 10 +++-------
 2 files changed, 9 insertions(+), 7 deletions(-)

diff --git a/gdb/gdbserver/ChangeLog b/gdb/gdbserver/ChangeLog
index 630335c..e01fa46 100644
--- a/gdb/gdbserver/ChangeLog
+++ b/gdb/gdbserver/ChangeLog
@@ -1,5 +1,11 @@
 2015-07-30  Yao Qi  <yao.qi@linaro.org>
 
+	* linux-arm-low.c (arm_hwcap): Remove it.
+	(arm_read_description): New local variable arm_hwcap.  Don't
+	set arm_hwcap to zero.
+
+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.
diff --git a/gdb/gdbserver/linux-arm-low.c b/gdb/gdbserver/linux-arm-low.c
index 02a1c08..3c5956b 100644
--- a/gdb/gdbserver/linux-arm-low.c
+++ b/gdb/gdbserver/linux-arm-low.c
@@ -117,8 +117,6 @@ struct arch_lwp_info
   CORE_ADDR stopped_data_address;
 };
 
-static unsigned long arm_hwcap;
-
 /* These are in <asm/elf.h> in current kernels.  */
 #define HWCAP_VFP       64
 #define HWCAP_IWMMXT    512
@@ -844,11 +842,11 @@ static const struct target_desc *
 arm_read_description (void)
 {
   int pid = lwpid_of (current_thread);
+  unsigned long arm_hwcap = 0;
 
   /* Query hardware watchpoint/breakpoint capabilities.  */
   arm_linux_init_hwbp_cap (pid);
 
-  arm_hwcap = 0;
   if (arm_get_hwcap (&arm_hwcap) == 0)
     return tdesc_arm;
 
@@ -875,10 +873,8 @@ arm_read_description (void)
       buf = xmalloc (32 * 8 + 4);
       if (ptrace (PTRACE_GETVFPREGS, pid, 0, buf) < 0
 	  && errno == EIO)
-	{
-	  arm_hwcap = 0;
-	  result = tdesc_arm;
-	}
+	result = tdesc_arm;
+
       free (buf);
 
       return result;


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