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


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

Completely untested.

2012-04-10  Pedro Alves  <palves@redhat.com>

	* linux-cris-low.c (tdesc_crisv32): Declare.
	(cris_arch_setup): New function.
	(cris_regsets_info, cris_usrregs_info, regs_info): New globals.
	(cris_regs_info): New function.
	(the_low_target): Adjust.
	(initialize_low_arch): New function.
---
 gdb/gdbserver/linux-crisv32-low.c |   50 +++++++++++++++++++++++++++++++++----
 1 files changed, 45 insertions(+), 5 deletions(-)

diff --git a/gdb/gdbserver/linux-crisv32-low.c b/gdb/gdbserver/linux-crisv32-low.c
index 1cc4cd1..ee30965 100644
--- a/gdb/gdbserver/linux-crisv32-low.c
+++ b/gdb/gdbserver/linux-crisv32-low.c
@@ -23,6 +23,7 @@
 
 /* Defined in auto-generated file reg-crisv32.c.  */
 void init_registers_crisv32 (void);
+extern struct target_desc *tdesc_crisv32;
 
 /* CRISv32 */
 #define cris_num_regs 49
@@ -362,19 +363,50 @@ cris_store_gregset (const void *buf)
     }
 }
 
+static void
+cris_arch_setup (void)
+{
+  current_process ()->tdesc = tdesc_crisv32;
+}
+
 typedef unsigned long elf_gregset_t[cris_num_regs];
 
-struct regset_info target_regsets[] = {
+static struct regset_info cris_regsets[] = {
   { PTRACE_GETREGS, PTRACE_SETREGS, 0, sizeof (elf_gregset_t),
     GENERAL_REGS, cris_fill_gregset, cris_store_gregset },
   { 0, 0, 0, -1, -1, NULL, NULL }
 };
 
+
+static struct regsets_info cris_regsets_info =
+  {
+    cris_regsets, /* regsets */
+    0, /* num_regsets */
+    NULL, /* disabled_regsets */
+  };
+
+static struct usrregs_info cris_usrregs_info =
+  {
+    cris_num_regs,
+    cris_regmap,
+  };
+
+static struct regs_info regs_info =
+  {
+    NULL, /* regset_bitmap */
+    &cris_usrregs_info,
+    &cris_regsets_info
+  };
+
+static const struct regs_info *
+cris_regs_info (void)
+{
+  return &regs_info;
+}
+
 struct linux_target_ops the_low_target = {
-  init_register_crisv32,
-  -1,
-  NULL,
-  NULL,
+  cris_arch_setup,
+  cris_regs_info,
   NULL,
   NULL,
   NULL, /* fetch_register */
@@ -390,3 +422,11 @@ struct linux_target_ops the_low_target = {
   cris_stopped_by_watchpoint,
   cris_stopped_data_address,
 };
+
+void
+initialize_low_arch (void)
+{
+  init_register_crisv32 ();
+
+  initialize_regsets_info (&cris_regsets_info);
+}


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