public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Andreas Arnez <arnez@linux.vnet.ibm.com>
To: gdb-patches@sourceware.org
Subject: [PATCH 10/11] SPARC: Replace regset_alloc() invocations by static regset structures.
Date: Thu, 15 May 2014 15:49:00 -0000	[thread overview]
Message-ID: <1400168975-3145-11-git-send-email-arnez@linux.vnet.ibm.com> (raw)
In-Reply-To: <1400168975-3145-1-git-send-email-arnez@linux.vnet.ibm.com>

gdb/
	* sparc-linux-tdep.c (sparc32_linux_gregset)
	(sparc32_linux_fpregset): New static regset structures.
	(sparc32_linux_init_abi): Drop dynamic regset allocations.
	* sparc-tdep.h (struct gdbarch_tdep): Constify 'gregset' and
	'fpregset' fields.
	* sparc64-linux-tdep.c: (sparc64_linux_gregset)
	(sparc64_linux_fpregset): New static regset structures.
	(sparc64_linux_init_abi): Drop dynamic regset allocations.
	* sparc64fbsd-tdep.c (sparc64fbsd_gregset, sparc64fbsd_fpregset):
	New static regset structures.
	(sparc64fbsd_init_abi): Drop dynamic regset allocations.
	* sparc64nbsd-tdep.c (sparc64nbsd_gregset, sparc64nbsd_fpregset):
	New static regset structures.
	(sparc64nbsd_init_abi): Drop dynamic regset allocations.
	* sparc64obsd-tdep.c (sparc64obsd_gregset, sparc64obsd_fpregset):
	New static regset structures.
	(sparc64obsd_init_abi): Drop dynamic regset allocations.
	* sparcnbsd-tdep.c (sparc32nbsd_gregset, sparc32nbsd_fpregset):
	New static regset structures.
	(sparc32nbsd_init_abi): Drop dynamic regset allocations.
---
 gdb/sparc-linux-tdep.c   | 20 ++++++++++++++++----
 gdb/sparc-tdep.h         |  4 ++--
 gdb/sparc64-linux-tdep.c | 20 ++++++++++++++++----
 gdb/sparc64fbsd-tdep.c   | 16 ++++++++++++----
 gdb/sparc64nbsd-tdep.c   | 14 ++++++++++++--
 gdb/sparc64obsd-tdep.c   | 15 ++++++++++++---
 gdb/sparcnbsd-tdep.c     | 14 ++++++++++++--
 7 files changed, 82 insertions(+), 21 deletions(-)

diff --git a/gdb/sparc-linux-tdep.c b/gdb/sparc-linux-tdep.c
index 4a193e2..fd1fc3d 100644
--- a/gdb/sparc-linux-tdep.c
+++ b/gdb/sparc-linux-tdep.c
@@ -403,6 +403,20 @@ sparc32_linux_gdb_signal_to_target (struct gdbarch *gdbarch,
 
 \f
 
+static const struct regset sparc32_linux_gregset =
+  {
+    NULL,
+    sparc32_linux_supply_core_gregset,
+    sparc32_linux_collect_core_gregset
+  };
+
+static const struct regset sparc32_linux_fpregset =
+  {
+    NULL,
+    sparc32_linux_supply_core_fpregset,
+    sparc32_linux_collect_core_fpregset
+  };
+
 static void
 sparc32_linux_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch)
 {
@@ -410,12 +424,10 @@ sparc32_linux_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch)
 
   linux_init_abi (info, gdbarch);
 
-  tdep->gregset = regset_alloc (gdbarch, sparc32_linux_supply_core_gregset,
-				sparc32_linux_collect_core_gregset);
+  tdep->gregset = &sparc32_linux_gregset;
   tdep->sizeof_gregset = 152;
 
-  tdep->fpregset = regset_alloc (gdbarch, sparc32_linux_supply_core_fpregset,
-				 sparc32_linux_collect_core_fpregset);
+  tdep->fpregset = &sparc32_linux_fpregset;
   tdep->sizeof_fpregset = 396;
 
   tramp_frame_prepend_unwinder (gdbarch, &sparc32_linux_sigframe);
diff --git a/gdb/sparc-tdep.h b/gdb/sparc-tdep.h
index 12c8ef7..13f0bb2 100644
--- a/gdb/sparc-tdep.h
+++ b/gdb/sparc-tdep.h
@@ -58,9 +58,9 @@ struct gdbarch_tdep
   int npc_regnum;
 
   /* Register sets.  */
-  struct regset *gregset;
+  const struct regset *gregset;
   size_t sizeof_gregset;
-  struct regset *fpregset;
+  const struct regset *fpregset;
   size_t sizeof_fpregset;
 
   /* Offset of saved PC in jmp_buf.  */
diff --git a/gdb/sparc64-linux-tdep.c b/gdb/sparc64-linux-tdep.c
index 6040526..e843eb3 100644
--- a/gdb/sparc64-linux-tdep.c
+++ b/gdb/sparc64-linux-tdep.c
@@ -280,6 +280,20 @@ sparc64_linux_get_longjmp_target (struct frame_info *frame, CORE_ADDR *pc)
 
 \f
 
+static const struct regset sparc64_linux_gregset =
+  {
+    NULL,
+    sparc64_linux_supply_core_gregset,
+    sparc64_linux_collect_core_gregset
+  };
+
+static const struct regset sparc64_linux_fpregset =
+  {
+    NULL,
+    sparc64_linux_supply_core_fpregset,
+    sparc64_linux_collect_core_fpregset
+  };
+
 static void
 sparc64_linux_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch)
 {
@@ -287,12 +301,10 @@ sparc64_linux_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch)
 
   linux_init_abi (info, gdbarch);
 
-  tdep->gregset = regset_alloc (gdbarch, sparc64_linux_supply_core_gregset,
-				sparc64_linux_collect_core_gregset);
+  tdep->gregset = &sparc64_linux_gregset;
   tdep->sizeof_gregset = 288;
 
-  tdep->fpregset = regset_alloc (gdbarch, sparc64_linux_supply_core_fpregset,
-				 sparc64_linux_collect_core_fpregset);
+  tdep->fpregset = &sparc64_linux_fpregset;
   tdep->sizeof_fpregset = 280;
 
   tramp_frame_prepend_unwinder (gdbarch, &sparc64_linux_rt_sigframe);
diff --git a/gdb/sparc64fbsd-tdep.c b/gdb/sparc64fbsd-tdep.c
index 6ca87dc..fde7815 100644
--- a/gdb/sparc64fbsd-tdep.c
+++ b/gdb/sparc64fbsd-tdep.c
@@ -209,17 +209,25 @@ static const struct frame_unwind sparc64fbsd_sigtramp_frame_unwind =
 };
 \f
 
+static const struct regset sparc64fbsd_gregset =
+  {
+    NULL, sparc64fbsd_supply_gregset, sparc64fbsd_collect_gregset
+  };
+
+static const struct regset sparc64fbsd_fpregset =
+  {
+    NULL, sparc64fbsd_supply_fpregset, sparc64fbsd_collect_fpregset
+  };
+
 static void
 sparc64fbsd_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch)
 {
   struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
 
-  tdep->gregset = regset_alloc (gdbarch, sparc64fbsd_supply_gregset,
-				sparc64fbsd_collect_gregset);
+  tdep->gregset = &sparc64fbsd_gregset;
   tdep->sizeof_gregset = 256;
 
-  tdep->fpregset = regset_alloc (gdbarch, sparc64fbsd_supply_fpregset,
-				 sparc64fbsd_collect_fpregset);
+  tdep->fpregset = &sparc64fbsd_fpregset;
   tdep->sizeof_fpregset = 272;
 
   frame_unwind_append_unwinder (gdbarch, &sparc64fbsd_sigtramp_frame_unwind);
diff --git a/gdb/sparc64nbsd-tdep.c b/gdb/sparc64nbsd-tdep.c
index fac4c27..b67c762 100644
--- a/gdb/sparc64nbsd-tdep.c
+++ b/gdb/sparc64nbsd-tdep.c
@@ -237,15 +237,25 @@ static const struct frame_unwind sparc64nbsd_sigcontext_frame_unwind =
 };
 \f
 
+static const struct regset sparc64nbsd_gregset =
+  {
+    NULL, sparc64nbsd_supply_gregset, NULL
+  };
+
+static const struct regset sparc64nbsd_fpregset =
+  {
+    NULL, sparc64nbsd_supply_fpregset, NULL
+  };
+
 static void
 sparc64nbsd_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch)
 {
   struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
 
-  tdep->gregset = regset_alloc (gdbarch, sparc64nbsd_supply_gregset, NULL);
+  tdep->gregset = &sparc64nbsd_gregset;
   tdep->sizeof_gregset = 160;
 
-  tdep->fpregset = regset_alloc (gdbarch, sparc64nbsd_supply_fpregset, NULL);
+  tdep->fpregset =  &sparc64nbsd_fpregset;
   tdep->sizeof_fpregset = 272;
 
   /* Make sure we can single-step "new" syscalls.  */
diff --git a/gdb/sparc64obsd-tdep.c b/gdb/sparc64obsd-tdep.c
index 8f94574..8cc04f7 100644
--- a/gdb/sparc64obsd-tdep.c
+++ b/gdb/sparc64obsd-tdep.c
@@ -403,15 +403,24 @@ sparc64obsd_collect_uthread(const struct regcache *regcache,
 }
 \f
 
+static const struct regset sparc64obsd_gregset =
+  {
+    NULL, sparc64obsd_supply_gregset, NULL
+  };
+
+static const struct regset sparc64obsd_fpregset =
+  {
+    NULL, sparc64obsd_supply_fpregset, NULL
+  };
+
 static void
 sparc64obsd_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch)
 {
   struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
 
-  tdep->gregset = regset_alloc (gdbarch, sparc64obsd_supply_gregset, NULL);
+  tdep->gregset = &sparc64obsd_gregset;
   tdep->sizeof_gregset = 288;
-
-  tdep->fpregset = regset_alloc (gdbarch, sparc64obsd_supply_fpregset, NULL);
+  tdep->fpregset = &sparc64obsd_fpregset;
   tdep->sizeof_fpregset = 272;
 
   /* Make sure we can single-step "new" syscalls.  */
diff --git a/gdb/sparcnbsd-tdep.c b/gdb/sparcnbsd-tdep.c
index ac94f10..b267842 100644
--- a/gdb/sparcnbsd-tdep.c
+++ b/gdb/sparcnbsd-tdep.c
@@ -283,6 +283,16 @@ sparcnbsd_step_trap (struct frame_info *frame, unsigned long insn)
 }
 \f
 
+static const struct regset sparc32nbsd_gregset =
+  {
+    NULL, sparc32nbsd_supply_gregset, NULL
+  };
+
+static const struct regset sparc32nbsd_fpregset =
+  {
+    NULL, sparc32nbsd_supply_fpregset, NULL
+  };
+
 static void
 sparc32nbsd_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch)
 {
@@ -292,10 +302,10 @@ sparc32nbsd_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch)
   set_gdbarch_long_double_bit (gdbarch, 64);
   set_gdbarch_long_double_format (gdbarch, floatformats_ieee_double);
 
-  tdep->gregset = regset_alloc (gdbarch, sparc32nbsd_supply_gregset, NULL);
+  tdep->gregset = &sparc32nbsd_gregset;
   tdep->sizeof_gregset = 20 * 4;
 
-  tdep->fpregset = regset_alloc (gdbarch, sparc32nbsd_supply_fpregset, NULL);
+  tdep->fpregset = &sparc32nbsd_fpregset;
   tdep->sizeof_fpregset = 33 * 4;
 
   /* Make sure we can single-step "new" syscalls.  */
-- 
1.8.4.2

  reply	other threads:[~2014-05-15 15:49 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-05-15 15:49 [PATCH 00/11] Regset rework preparations part 1 Andreas Arnez
2014-05-15 15:49 ` Andreas Arnez [this message]
2014-05-15 15:49 ` [PATCH 03/11] AARCH64: Replace regset_alloc() invocations by static regset structures Andreas Arnez
2014-05-15 15:49 ` [PATCH 11/11] Drop regset_alloc() Andreas Arnez
2014-05-15 15:49 ` [PATCH 04/11] ARM: Replace regset_alloc() invocations by static regset structures Andreas Arnez
2014-05-15 15:49 ` [PATCH 08/11] SCORE: Replace regset_alloc() invocation by a static regset structure Andreas Arnez
2014-05-15 15:49 ` [PATCH 06/11] MIPS: Replace regset_alloc() invocations by static regset structures Andreas Arnez
2014-05-15 15:49 ` [PATCH 02/11] Remove 'arch' field from regset structure Andreas Arnez
2014-05-15 15:49 ` [PATCH 05/11] X86: Replace regset_alloc() invocations by static regset structures Andreas Arnez
2014-05-15 15:49 ` [PATCH 09/11] SPARC: Rename register maps from "*regset" to "*regmap" Andreas Arnez
2014-05-15 15:50 ` [PATCH 01/11] Constify regset structures Andreas Arnez
2014-05-15 15:59 ` [PATCH 07/11] MN10300: Replace regset_alloc() invocations by static " Andreas Arnez
2014-05-19  7:32 ` [PING] [PATCH 00/11] Regset rework preparations part 1 Andreas Arnez
2014-05-20 20:41   ` Maciej W. Rozycki
2014-05-21 10:39   ` Pedro Alves
2014-05-22  7:28     ` Andreas Krebbel

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=1400168975-3145-11-git-send-email-arnez@linux.vnet.ibm.com \
    --to=arnez@linux.vnet.ibm.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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).