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 regcache_descr fields sizeof_raw_register_status and sizeof_cooked_register_status


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

commit 6c5218dfdb7b38cc1617be7753cc1ec6d0612382
Author: Yao Qi <yao.qi@linaro.org>
Date:   Thu Nov 2 15:05:12 2017 +0000

    Remove regcache_descr fields sizeof_raw_register_status and sizeof_cooked_register_status
    
    struct regcache_descr has two fields sizeof_raw_register_status
    and sizeof_cooked_register_status, but they equal to nr_cooked_registers
    and nr_raw_registers respectively, so this patch removes them.
    
    gdb:
    
    2017-11-02  Yao Qi  <yao.qi@linaro.org>
    
    	* regcache.c (struct regcache_descr) <sizeof_raw_register_status>:
    	Remove.
    	<sizeof_cooked_register_status>: Remove.
    	(init_regcache_descr): Update.
    	(regcache::regcache): Use nr_cooked_registers and nr_raw_registers.
    	(regcache::save): Likewise.
    	(regcache::dump): Likewise.

Diff:
---
 gdb/ChangeLog  | 10 ++++++++++
 gdb/regcache.c | 13 ++++---------
 2 files changed, 14 insertions(+), 9 deletions(-)

diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index f3100f4..5f9bf3b 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,13 @@
+2017-11-02  Yao Qi  <yao.qi@linaro.org>
+
+	* regcache.c (struct regcache_descr) <sizeof_raw_register_status>:
+	Remove.
+	<sizeof_cooked_register_status>: Remove.
+	(init_regcache_descr): Update.
+	(regcache::regcache): Use nr_cooked_registers and nr_raw_registers.
+	(regcache::save): Likewise.
+	(regcache::dump): Likewise.
+
 2017-11-01  James Bowman  <james.bowman@ftdichip.com>
 
 	* ft32-tdep.c (ft32_fetch_instruction): New function.
diff --git a/gdb/regcache.c b/gdb/regcache.c
index 1ba49ad..5a1152e 100644
--- a/gdb/regcache.c
+++ b/gdb/regcache.c
@@ -53,7 +53,6 @@ struct regcache_descr
      cache.  */
   int nr_raw_registers;
   long sizeof_raw_registers;
-  long sizeof_raw_register_status;
 
   /* The cooked register space.  Each cooked register in the range
      [0..NR_RAW_REGISTERS) is direct-mapped onto the corresponding raw
@@ -63,7 +62,6 @@ struct regcache_descr
      gdbarch_pseudo_register_read and gdbarch_pseudo_register_write.  */
   int nr_cooked_registers;
   long sizeof_cooked_registers;
-  long sizeof_cooked_register_status;
 
   /* Offset and size (in 8 bit bytes), of each register in the
      register cache.  All registers (including those in the range
@@ -92,8 +90,6 @@ init_regcache_descr (struct gdbarch *gdbarch)
      either mapped onto raw-registers or memory.  */
   descr->nr_cooked_registers = gdbarch_num_regs (gdbarch)
 			       + gdbarch_num_pseudo_regs (gdbarch);
-  descr->sizeof_cooked_register_status
-    = gdbarch_num_regs (gdbarch) + gdbarch_num_pseudo_regs (gdbarch);
 
   /* Fill in a table of register types.  */
   descr->register_type
@@ -105,7 +101,6 @@ init_regcache_descr (struct gdbarch *gdbarch)
   /* Construct a strictly RAW register cache.  Don't allow pseudo's
      into the register cache.  */
   descr->nr_raw_registers = gdbarch_num_regs (gdbarch);
-  descr->sizeof_raw_register_status = gdbarch_num_regs (gdbarch);
 
   /* Lay out the register cache.
 
@@ -199,13 +194,13 @@ regcache::regcache (gdbarch *gdbarch, address_space *aspace_,
     {
       m_registers = XCNEWVEC (gdb_byte, m_descr->sizeof_cooked_registers);
       m_register_status = XCNEWVEC (signed char,
-				    m_descr->sizeof_cooked_register_status);
+				    m_descr->nr_cooked_registers);
     }
   else
     {
       m_registers = XCNEWVEC (gdb_byte, m_descr->sizeof_raw_registers);
       m_register_status = XCNEWVEC (signed char,
-				    m_descr->sizeof_raw_register_status);
+				    m_descr->nr_raw_registers);
     }
   m_ptid = minus_one_ptid;
 }
@@ -306,7 +301,7 @@ regcache::save (regcache_cooked_read_ftype *cooked_read,
   gdb_assert (m_readonly_p);
   /* Clear the dest.  */
   memset (m_registers, 0, m_descr->sizeof_cooked_registers);
-  memset (m_register_status, 0, m_descr->sizeof_cooked_register_status);
+  memset (m_register_status, 0, m_descr->nr_cooked_registers);
   /* Copy over any registers (identified by their membership in the
      save_reggroup) and mark them as valid.  The full [0 .. gdbarch_num_regs +
      gdbarch_num_pseudo_regs) range is checked since some architectures need
@@ -1343,7 +1338,7 @@ regcache::dump (ui_file *file, enum regcache_dump_what what_to_dump)
   fprintf_unfiltered (file, "sizeof_raw_registers %ld\n",
 		      m_descr->sizeof_raw_registers);
   fprintf_unfiltered (file, "sizeof_raw_register_status %ld\n",
-		      m_descr->sizeof_raw_register_status);
+		      m_descr->nr_raw_registers);
   fprintf_unfiltered (file, "gdbarch_num_regs %d\n", 
 		      gdbarch_num_regs (gdbarch));
   fprintf_unfiltered (file, "gdbarch_num_pseudo_regs %d\n",


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