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

[PATCH 11/22] [GDBserver] Multi-process + multi-arch: GNU/Linux CRIS


This adjusts the GNU/Linux CRIS port to new interfaces.

Completely untested.

2012-05-29  Pedro Alves  <palves@redhat.com>

	* linux-cris-low.c (tdesc_cris): Declare.
	(cris_arch_setup): New function.
	(cris_usrregs_info, regs_info): New globals.
	(cris_regs_info): New function.
	(the_low_target): Adjust.
	(initialize_low_arch): New function.
---
 gdb/gdbserver/linux-cris-low.c |   37 +++++++++++++++++++++++++++++++++----
 1 file changed, 33 insertions(+), 4 deletions(-)

diff --git a/gdb/gdbserver/linux-cris-low.c b/gdb/gdbserver/linux-cris-low.c
index b9217de..c5d599f 100644
--- a/gdb/gdbserver/linux-cris-low.c
+++ b/gdb/gdbserver/linux-cris-low.c
@@ -22,6 +22,7 @@
 
 /* Defined in auto-generated file reg-cris.c.  */
 void init_registers_cris (void);
+extern struct target_desc *tdesc_cris;
 
 /* CRISv10 */
 #define cris_num_regs 32
@@ -107,11 +108,33 @@ cris_reinsert_addr (void)
   return pc;
 }
 
+static void
+cris_arch_setup (void)
+{
+  current_process ()->tdesc = tdesc_cris;
+}
+
+static struct usrregs_info cris_usrregs_info =
+  {
+    cris_num_regs,
+    cris_regmap,
+  };
+
+static struct regs_info regs_info =
+  {
+    NULL, /* regset_bitmap */
+    &cris_usrregs_info,
+  };
+
+static const struct regs_info *
+cris_regs_info (void)
+{
+  return &regs_info;
+}
+
 struct linux_target_ops the_low_target = {
-  init_registers_cris,
-  cris_num_regs,
-  cris_regmap,
-  NULL,
+  cris_arch_setup,
+  cris_regs_info,
   cris_cannot_fetch_register,
   cris_cannot_store_register,
   NULL, /* fetch_register */
@@ -127,3 +150,9 @@ struct linux_target_ops the_low_target = {
   0,
   0,
 };
+
+void
+initialize_low_arch (void)
+{
+  init_registers_cris ();
+}


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