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 12/20] Multi-process + multiarch: GDBserver: GNU/Linux CRIS


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

Completely untested.

2012-04-10  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 files changed, 33 insertions(+), 4 deletions(-)

diff --git a/gdb/gdbserver/linux-cris-low.c b/gdb/gdbserver/linux-cris-low.c
index 0c92e62..4ca9d55 100644
--- a/gdb/gdbserver/linux-cris-low.c
+++ b/gdb/gdbserver/linux-cris-low.c
@@ -23,6 +23,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
@@ -108,11 +109,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 */
@@ -128,3 +151,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]