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 08/22] [GDBserver] Multi-process + multi-arch: GNU/Linux m68k


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

Built with a cross m68k-linux toolchain.  Otherwise not tested.

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

	* linux-m68k-low.c (tdesc_m68k): Declare.
	(target_regsets): Rename to ...
	(m68k_regsets): ... this, and make static.
	(m68k_regsets_info, m68k_usrregs_info, regs_info): New globals.
	(m68k_regs_info): New function.
	(m68k_arch_setup): New function.
	(the_low_target): Adjust.
	(initialize_low_arch): New function.
---
 gdb/gdbserver/linux-m68k-low.c |   50 ++++++++++++++++++++++++++++++++++++----
 1 file changed, 45 insertions(+), 5 deletions(-)

diff --git a/gdb/gdbserver/linux-m68k-low.c b/gdb/gdbserver/linux-m68k-low.c
index bc59e3e..df77dcf 100644
--- a/gdb/gdbserver/linux-m68k-low.c
+++ b/gdb/gdbserver/linux-m68k-low.c
@@ -21,6 +21,7 @@
 
 /* Defined in auto-generated file reg-m68k.c.  */
 void init_registers_m68k (void);
+extern struct target_desc *tdesc_m68k;
 
 #ifdef HAVE_SYS_REG_H
 #include <sys/reg.h>
@@ -109,7 +110,7 @@ m68k_store_fpregset (struct regcache *regcache, const void *buf)
 
 #endif /* HAVE_PTRACE_GETREGS */
 
-struct regset_info target_regsets[] = {
+static struct regset_info m68k_regsets[] = {
 #ifdef HAVE_PTRACE_GETREGS
   { PTRACE_GETREGS, PTRACE_SETREGS, 0, sizeof (elf_gregset_t),
     GENERAL_REGS,
@@ -174,11 +175,41 @@ ps_get_thread_area (const struct ps_prochandle *ph,
 }
 #endif /* PTRACE_GET_THREAD_AREA */
 
+static struct regsets_info m68k_regsets_info =
+  {
+    m68k_regsets, /* regsets */
+    0, /* num_regsets */
+    NULL, /* disabled_regsets */
+  };
+
+static struct usrregs_info m68k_usrregs_info =
+  {
+    m68k_num_regs,
+    m68k_regmap,
+  };
+
+static struct regs_info regs_info =
+  {
+    NULL, /* regset_bitmap */
+    &m68k_usrregs_info,
+    &m68k_regsets_info
+  };
+
+static const struct regs_info *
+m68k_regs_info (void)
+{
+  return &regs_info;
+}
+
+static void
+m68k_arch_setup (void)
+{
+  current_process ()->tdesc = tdesc_m68k;
+}
+
 struct linux_target_ops the_low_target = {
-  init_registers_m68k,
-  m68k_num_regs,
-  m68k_regmap,
-  NULL,
+  m68k_arch_setup,
+  m68k_regs_info,
   m68k_cannot_fetch_register,
   m68k_cannot_store_register,
   NULL, /* fetch_register */
@@ -190,3 +221,12 @@ struct linux_target_ops the_low_target = {
   2,
   m68k_breakpoint_at,
 };
+
+void
+initialize_low_arch (void)
+{
+  /* Initialize the Linux target descriptions.  */
+  init_registers_m68k ();
+
+  initialize_regsets_info (&m68k_regsets_info);
+}


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