Patchwork [RX] RXv2 support

login
register
mail settings
Submitter Yoshinori Sato
Date April 7, 2015, 5:43 a.m.
Message ID <874mos7ate.wl-ysato@users.sourceforge.jp>
Download mbox | patch
Permalink /patch/6032/
State New
Headers show

Comments

Yoshinori Sato - April 7, 2015, 5:43 a.m.
RXv2 added some register and extend accumulator.

http://documentation.renesas.com/doc/products/mpumcu/doc/rx_family/r01us0071ej0100_rxv2sm.pdf

This patch add extb and extent accumulator size.
Pedro Alves - April 7, 2015, 8:31 a.m.
On 04/07/2015 06:43 AM, Yoshinori Sato wrote:
> RXv2 added some register and extend accumulator.
> 
> http://documentation.renesas.com/doc/products/mpumcu/doc/rx_family/r01us0071ej0100_rxv2sm.pdf
> 
> This patch add extb and extent accumulator size.
> 

It isn't right to unconditionally present these registers to the user
when debugging targets that don't have them.

The right way to fix this is to add a new xml target description,
which includes a new feature, like e.g., "org.gnu.gdb.rx2.core".
Look for tdesc_has_registers in the various ports in the tree.

Thanks,
Pedro Alves
Yoshinori Sato - April 8, 2015, 5:41 a.m.
At Tue, 07 Apr 2015 09:31:28 +0100,
Pedro Alves wrote:
> 
> On 04/07/2015 06:43 AM, Yoshinori Sato wrote:
> > RXv2 added some register and extend accumulator.
> > 
> > http://documentation.renesas.com/doc/products/mpumcu/doc/rx_family/r01us0071ej0100_rxv2sm.pdf
> > 
> > This patch add extb and extent accumulator size.
> > 
> 
> It isn't right to unconditionally present these registers to the user
> when debugging targets that don't have them.
> 
> The right way to fix this is to add a new xml target description,
> which includes a new feature, like e.g., "org.gnu.gdb.rx2.core".
> Look for tdesc_has_registers in the various ports in the tree.

OK.
I trying it.
Thanks.

> Thanks,
> Pedro Alves
>

Patch

diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index cfe7961..cf72533 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,11 @@ 
+2015-04-07  Yoshinori Sato  <ysato@users.sourceforge.jp>
+
+	* rx-tdep.c (RX_ACC_REGNUM): Change to RX_ACC0_REGNUM.
+	(RX_NUM_REGS): Added new registers.
+	(RX_ACC0_REGNUM, RX_ACC1_REGNUM): New.
+	(rx_register_name): Add new registers.
+	(rx_register_type): extend acc size.
+
 2015-04-06  Doug Evans  <xdje42@gmail.com>
 
 	* symtab.c (hash_symbol_entry): Hash STRUCT_DOMAIN symbols as
diff --git a/gdb/rx-tdep.c b/gdb/rx-tdep.c
index aa44f7a..8daf040 100644
--- a/gdb/rx-tdep.c
+++ b/gdb/rx-tdep.c
@@ -46,8 +46,9 @@  enum
   RX_FP_REGNUM = 6,
   RX_R15_REGNUM = 15,
   RX_PC_REGNUM = 19,
-  RX_ACC_REGNUM = 25,
-  RX_NUM_REGS = 26
+  RX_ACC0_REGNUM = 25,
+  RX_ACC1_REGNUM = 26,
+  RX_NUM_REGS = 28
 };
 
 /* Architecture specific data.  */
@@ -121,7 +122,9 @@  rx_register_name (struct gdbarch *gdbarch, int regnr)
     "bpc",
     "fintv",
     "fpsw",
-    "acc"
+    "acc0",
+    "acc1",
+    "extb"
   };
 
   return reg_names[regnr];
@@ -133,8 +136,8 @@  rx_register_type (struct gdbarch *gdbarch, int reg_nr)
 {
   if (reg_nr == RX_PC_REGNUM)
     return builtin_type (gdbarch)->builtin_func_ptr;
-  else if (reg_nr == RX_ACC_REGNUM)
-    return builtin_type (gdbarch)->builtin_unsigned_long_long;
+  else if (reg_nr == RX_ACC0_REGNUM || reg_nr == RX_ACC1_REGNUM)
+    return builtin_type (gdbarch)->builtin_uint128;
   else
     return builtin_type (gdbarch)->builtin_unsigned_long;
 }
diff --git a/include/ChangeLog b/include/ChangeLog
index 35da015..97f2eee 100644
--- a/include/ChangeLog
+++ b/include/ChangeLog
@@ -1,3 +1,7 @@ 
+2015-04-07  Yoshinori Sato <ysato@users.sourceforge.jp>
+
+	* gdb/sim-rx.h (sim_rx_regnum): Add new register.
+
 2015-03-10  Matthew Wahab  <matthew.wahab@arm.com>
 
 	PR ld/16572