Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Pedro Alves <palves@redhat.com>
To: gdb-patches@sourceware.org
Subject: [PATCH 08/22] [GDBserver] Multi-process + multi-arch: GNU/Linux m68k
Date: Wed, 29 May 2013 16:27:00 -0000	[thread overview]
Message-ID: <20130529162652.24586.77558.stgit@brno.lan> (raw)
In-Reply-To: <20130529162434.24586.5697.stgit@brno.lan>

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);
+}


  parent reply	other threads:[~2013-05-29 16:27 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-05-29 16:24 [PATCH 00/22] [GDBserver] Multi-process + multi-arch Pedro Alves
2013-05-29 16:25 ` [PATCH 04/22] [GDBserver] Multi-process + multi-arch: GNU/Linux PowerPC Pedro Alves
2013-05-29 16:25 ` [PATCH 01/22] [GDBserver] Multi-process + multi-arch: core + GNU/Linux x86* Pedro Alves
2013-05-29 19:03   ` Tom Tromey
2013-05-30 12:01     ` Pedro Alves
2013-05-29 16:25 ` [PATCH 03/22] [GDBserver] Multi-process + multi-arch: GNU/Linux SPARC Pedro Alves
2013-05-29 16:25 ` [PATCH 02/22] [GDBserver] Multi-process + multi-arch: GNU/Linux IA64 Pedro Alves
2013-05-29 16:26 ` [PATCH 05/22] [GDBserver] Multi-process + multi-arch: GNU/Linux S/390 Pedro Alves
2013-05-29 16:26 ` [PATCH 06/22] [GDBserver] Multi-process + multi-arch: GNU/Linux MIPS Pedro Alves
2013-05-29 16:26 ` [PATCH 07/22] [GDBserver] Multi-process + multi-arch: GNU/Linux ARM Pedro Alves
2013-05-29 16:27 ` [PATCH 10/22] [GDBserver] Multi-process + multi-arch: GNU/Linux Blackfin Pedro Alves
2013-05-29 16:27 ` [PATCH 09/22] [GDBserver] Multi-process + multi-arch: GNU/Linux SH Pedro Alves
2013-05-29 16:27 ` Pedro Alves [this message]
2013-05-29 16:27 ` [PATCH 11/22] [GDBserver] Multi-process + multi-arch: GNU/Linux CRIS Pedro Alves
2013-05-29 16:28 ` [PATCH 12/22] [GDBserver] Multi-process + multi-arch: GNU/Linux CRISv32 Pedro Alves
2013-05-29 16:28 ` [PATCH 13/22] [GDBserver] Multi-process + multi-arch: GNU/Linux M32R Pedro Alves
2013-05-29 16:28 ` [PATCH 15/22] [GDBserver] Multi-process + multi-arch: GNU/Linux Xtensa Pedro Alves
2013-05-29 16:28 ` [PATCH 14/22] [GDBserver] Multi-process + multi-arch: GNU/Linux TI C6x Pedro Alves
2013-05-29 16:29 ` [PATCH 18/22] [GDBserver] Multi-process + multi-arch: GNU/Linux TILE-Gx Pedro Alves
2013-05-29 16:29 ` [PATCH 17/22] [GDBserver] Multi-process + multi-arch: GNU/Linux Aarch64 Pedro Alves
2013-05-29 16:29 ` [PATCH 16/22] [GDBserver] Multi-process + multi-arch: GNU/Linux Nios 2 Pedro Alves
2013-05-29 16:30 ` [PATCH 19/22] [GDBserver] Multi-process + multi-arch: SPU Pedro Alves
2013-05-29 16:30 ` [PATCH 21/22] [GDBserver] Multi-process + multi-arch: LynxOS Pedro Alves
2013-05-29 16:30 ` [PATCH 22/22] [GDBserver] Multi-process + multi-arch: QNX NTO Pedro Alves
2013-05-29 17:22 ` [PATCH 20/22] [GDBserver] Multi-process + multi-arch: Windows Pedro Alves
2013-05-29 17:29 ` [PATCH 00/22] [GDBserver] Multi-process + multi-arch Pedro Alves
2013-05-30 12:13 [PATCH 00/22 v3] " Pedro Alves
2013-05-30 12:14 ` [PATCH 08/22] [GDBserver] Multi-process + multi-arch: GNU/Linux m68k Pedro Alves

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20130529162652.24586.77558.stgit@brno.lan \
    --to=palves@redhat.com \
    --cc=gdb-patches@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox