Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Pedro Alves <palves@redhat.com>
To: Yao Qi <yao@codesourcery.com>
Cc: gdb-patches@sourceware.org
Subject: Re: [PATCH 14/22] [GDBserver] Multi-process + multi-arch: GNU/Linux TI C6x
Date: Mon, 03 Jun 2013 15:25:00 -0000	[thread overview]
Message-ID: <51ACB56D.2040005@redhat.com> (raw)
In-Reply-To: <51AC5ED8.3040704@codesourcery.com>

On 06/03/2013 10:16 AM, Yao Qi wrote:
> 
> I didn't run the testsuite with this patch, because the board isn't stable.  Run a small test and GDBserver behaves correctly.
> 

Thanks.  I've adjusted the commit log to mention that.

-----
Subject: [PATCH] [GDBserver] Multi-process + multi-arch: GNU/Linux TI C6x

This adjusts the GNU/Linux TI C6x port to new interfaces.

Smoked tested by Yao Qi.

gdb/gdbserver/
	* linux-tic6x-low.c (tdesc_tic6x_c64xp_linux)
	(tdesc_tic6x_c64x_linux, tdesc_tic6x_c62x_linux): Declare.
	(tic6x_usrregs_info): Forward declare.
	(tic6x_read_description): New function, based on ...
	(tic6x_arch_setup): ... this.  Reimplement.
	(target_regsets): Rename to ...
	(tic6x_regsets): ... this, and make static.
	(tic6x_regsets_info, tic6x_usrregs_info, regs_info): New globals.
	(tic6x_regs_info): New function.
	(the_low_target): Adjust.
	(initialize_low_arch): New function.
---
 gdb/gdbserver/linux-tic6x-low.c | 73 ++++++++++++++++++++++++++++++++++-------
 1 file changed, 62 insertions(+), 11 deletions(-)

diff --git a/gdb/gdbserver/linux-tic6x-low.c b/gdb/gdbserver/linux-tic6x-low.c
index 93a1e65..2367dea 100644
--- a/gdb/gdbserver/linux-tic6x-low.c
+++ b/gdb/gdbserver/linux-tic6x-low.c
@@ -38,10 +38,15 @@
 
 /* Defined in auto-generated file tic6x-c64xp-linux.c.  */
 void init_registers_tic6x_c64xp_linux (void);
+extern const struct target_desc *tdesc_tic6x_c64xp_linux;
+
 /* Defined in auto-generated file tic6x-c64x-linux.c.  */
 void init_registers_tic6x_c64x_linux (void);
+extern const struct target_desc *tdesc_tic6x_c64x_linux;
+
 /* Defined in auto-generated file tic62x-c6xp-linux.c.  */
 void init_registers_tic6x_c62x_linux (void);
+extern const struct target_desc *tdesc_tic6x_c62x_linux;
 
 union tic6x_register
 {
@@ -167,11 +172,15 @@ extern struct linux_target_ops the_low_target;
 static int *tic6x_regmap;
 static unsigned int tic6x_breakpoint;
 
-static void
-tic6x_arch_setup (void)
+/* Forward definition.  */
+static struct usrregs_info tic6x_usrregs_info;
+
+static const struct target_desc *
+tic6x_read_description (void)
 {
   register unsigned int csr asm ("B2");
   unsigned int cpuid;
+  const struct target_desc *tdesc;
 
   /* Determine the CPU we're running on to find the register order.  */
   __asm__ ("MVC .S2 CSR,%0" : "=r" (csr) :);
@@ -182,29 +191,30 @@ tic6x_arch_setup (void)
     case 0x02: /* C67x */
       tic6x_regmap = tic6x_regmap_c62x;
       tic6x_breakpoint = 0x0000a122;  /* BNOP .S2 0,5 */
-      init_registers_tic6x_c62x_linux ();
+      tdesc = tdesc_tic6x_c62x_linux;
       break;
     case 0x03: /* C67x+ */
       tic6x_regmap = tic6x_regmap_c64x;
       tic6x_breakpoint = 0x0000a122;  /* BNOP .S2 0,5 */
-      init_registers_tic6x_c64x_linux ();
+      tdesc = tdesc_tic6x_c64x_linux;
       break;
     case 0x0c: /* C64x */
       tic6x_regmap = tic6x_regmap_c64x;
       tic6x_breakpoint = 0x0000a122;  /* BNOP .S2 0,5 */
-      init_registers_tic6x_c64x_linux ();
+      tdesc = tdesc_tic6x_c64x_linux;
       break;
     case 0x10: /* C64x+ */
     case 0x14: /* C674x */
     case 0x15: /* C66x */
       tic6x_regmap = tic6x_regmap_c64xp;
       tic6x_breakpoint = 0x56454314;  /* illegal opcode */
-      init_registers_tic6x_c64xp_linux ();
+      tdesc = tdesc_tic6x_c64xp_linux;
       break;
     default:
       error ("Unknown CPU ID 0x%02x", cpuid);
     }
-  the_low_target.regmap = tic6x_regmap;
+  tic6x_usrregs_info.regmap = tic6x_regmap;
+  return tdesc;
 }
 
 static int
@@ -311,17 +321,47 @@ tic6x_store_gregset (struct regcache *regcache, const void *buf)
       tic6x_supply_register (regcache, i, regset + tic6x_regmap[i]);
 }
 
-struct regset_info target_regsets[] = {
+static struct regset_info tic6x_regsets[] = {
   { PTRACE_GETREGS, PTRACE_SETREGS, 0, TIC6X_NUM_REGS * 4, GENERAL_REGS,
     tic6x_fill_gregset, tic6x_store_gregset },
   { 0, 0, 0, -1, -1, NULL, NULL }
 };
 
+static void
+tic6x_arch_setup (void)
+{
+  current_process ()->tdesc = tic6x_read_description ();
+}
+
+static struct regsets_info tic6x_regsets_info =
+  {
+    tic6x_regsets, /* regsets */
+    0, /* num_regsets */
+    NULL, /* disabled_regsets */
+  };
+
+static struct usrregs_info tic6x_usrregs_info =
+  {
+    TIC6X_NUM_REGS,
+    NULL, /* Set in tic6x_read_description.  */
+  };
+
+static struct regs_info regs_info =
+  {
+    NULL, /* regset_bitmap */
+    &tic6x_usrregs_info,
+    &tic6x_regsets_info
+  };
+
+static const struct regs_info *
+tic6x_regs_info (void)
+{
+  return &regs_info;
+}
+
 struct linux_target_ops the_low_target = {
   tic6x_arch_setup,
-  TIC6X_NUM_REGS,
-  0,
-  NULL,
+  tic6x_regs_info,
   tic6x_cannot_fetch_register,
   tic6x_cannot_store_register,
   NULL, /* fetch_register */
@@ -333,3 +373,14 @@ struct linux_target_ops the_low_target = {
   0,
   tic6x_breakpoint_at,
 };
+
+void
+initialize_low_arch (void)
+{
+  /* Initialize the Linux target descriptions.  */
+  init_registers_tic6x_c64xp_linux ();
+  init_registers_tic6x_c64x_linux ();
+  init_registers_tic6x_c62x_linux ();
+
+  initialize_regsets_info (&tic6x_regsets_info);
+}
-- 
1.7.11.7



  reply	other threads:[~2013-06-03 15:25 UTC|newest]

Thread overview: 39+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-05-30 12:13 [PATCH 00/22 v3] [GDBserver] Multi-process + multi-arch Pedro Alves
2013-05-30 12:13 ` [PATCH 01/22] [GDBserver] Multi-process + multi-arch: core + GNU/Linux x86* Pedro Alves
2013-06-03  8:47   ` Yao Qi
2013-06-03 15:24     ` Pedro Alves
2013-05-30 12:14 ` [PATCH 03/22] [GDBserver] Multi-process + multi-arch: GNU/Linux SPARC Pedro Alves
2013-05-30 12:14 ` [PATCH 07/22] [GDBserver] Multi-process + multi-arch: GNU/Linux ARM Pedro Alves
2013-05-30 12:14 ` [PATCH 11/22] [GDBserver] Multi-process + multi-arch: GNU/Linux CRIS Pedro Alves
2013-05-30 12:14 ` [PATCH 08/22] [GDBserver] Multi-process + multi-arch: GNU/Linux m68k Pedro Alves
2013-05-30 12:14 ` [PATCH 06/22] [GDBserver] Multi-process + multi-arch: GNU/Linux MIPS Pedro Alves
2013-05-30 12:14 ` [PATCH 02/22] [GDBserver] Multi-process + multi-arch: GNU/Linux IA64 Pedro Alves
2013-05-30 12:14 ` [PATCH 10/22] [GDBserver] Multi-process + multi-arch: GNU/Linux Blackfin Pedro Alves
2013-05-30 12:14 ` [PATCH 09/22] [GDBserver] Multi-process + multi-arch: GNU/Linux SH Pedro Alves
2013-05-30 12:14 ` [PATCH 05/22] [GDBserver] Multi-process + multi-arch: GNU/Linux S/390 Pedro Alves
2013-05-30 12:14 ` [PATCH 04/22] [GDBserver] Multi-process + multi-arch: GNU/Linux PowerPC Pedro Alves
2013-05-30 12:15 ` [PATCH 13/22] [GDBserver] Multi-process + multi-arch: GNU/Linux M32R Pedro Alves
2013-05-30 12:15 ` [PATCH 17/22] [GDBserver] Multi-process + multi-arch: GNU/Linux Aarch64 Pedro Alves
2013-05-30 12:15 ` [PATCH 18/22] [GDBserver] Multi-process + multi-arch: GNU/Linux TILE-Gx Pedro Alves
2013-05-30 12:15 ` [PATCH 12/22] [GDBserver] Multi-process + multi-arch: GNU/Linux CRISv32 Pedro Alves
2013-05-30 12:15 ` [PATCH 16/22] [GDBserver] Multi-process + multi-arch: GNU/Linux Nios 2 Pedro Alves
2013-05-30 12:15 ` [PATCH 19/22] [GDBserver] Multi-process + multi-arch: SPU Pedro Alves
2013-05-30 12:15 ` [PATCH 15/22] [GDBserver] Multi-process + multi-arch: GNU/Linux Xtensa Pedro Alves
2013-05-30 12:15 ` [PATCH 14/22] [GDBserver] Multi-process + multi-arch: GNU/Linux TI C6x Pedro Alves
2013-06-03  9:15   ` Yao Qi
2013-06-03 15:25     ` Pedro Alves [this message]
2013-05-30 12:16 ` [PATCH 22/22] [GDBserver] Multi-process + multi-arch: QNX NTO Pedro Alves
2013-05-30 12:16 ` [PATCH 20/22] [GDBserver] Multi-process + multi-arch: Windows Pedro Alves
2013-05-30 12:16 ` [PATCH 21/22] [GDBserver] Multi-process + multi-arch: LynxOS Pedro Alves
2013-06-07 10:51 ` [COMMIT PATCH][GDBserver] Multi-process + multi-arch Pedro Alves
2013-06-07 10:57   ` Pedro Alves
2013-06-08  1:56   ` gdbserver regression [Re: [COMMIT PATCH][GDBserver] Multi-process + multi-arch] Jan Kratochvil
2013-06-10 10:24     ` Pedro Alves
2013-06-11 13:57     ` Pedro Alves
2013-06-11 15:44       ` Jan Kratochvil
2013-06-11 15:51         ` Pedro Alves
2013-06-11 18:07           ` Pedro Alves
2013-06-12 14:53             ` gdbserver regression #2 " Jan Kratochvil
2013-06-12 15:09               ` Pedro Alves
2013-06-12 16:47                 ` Pedro Alves
  -- strict thread matches above, loose matches on Subject: below --
2013-05-29 16:24 [PATCH 00/22] [GDBserver] Multi-process + multi-arch Pedro Alves
2013-05-29 16:28 ` [PATCH 14/22] [GDBserver] Multi-process + multi-arch: GNU/Linux TI C6x 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=51ACB56D.2040005@redhat.com \
    --to=palves@redhat.com \
    --cc=gdb-patches@sourceware.org \
    --cc=yao@codesourcery.com \
    /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