From: Andreas Arnez <arnez@linux.vnet.ibm.com>
To: gdb-patches@sourceware.org
Cc: Randolph Chung <tausq@debian.org>
Subject: [PATCH 08/26] HPPA: Migrate from 'regset_from_core_section' to 'iterate_over_regset_sections'
Date: Fri, 12 Sep 2014 15:40:00 -0000 [thread overview]
Message-ID: <1410536396-25524-9-git-send-email-arnez@linux.vnet.ibm.com> (raw)
In-Reply-To: <1410536396-25524-1-git-send-email-arnez@linux.vnet.ibm.com>
For HP PA-RISC targets, no longer define the gdbarch method
'regset_from_core_section', but the iterator method instead.
gdb/ChangeLog:
* hppa-hpux-tdep.c (hppa_hpux_regset_from_core_section): Remove.
(hppa_hpux_iterate_over_regset_sections): New.
(hppa_hpux_init_abi): Adjust gdbarch initialization.
* hppa-linux-tdep.c (hppa_linux_regset_from_core_section): Remove.
(hppa_linux_iterate_over_regset_sections): New.
(hppa_linux_init_abi): Adjust.
* hppanbsd-tdep.c (hppaobsd_regset_from_core_section): Remove.
(hppanbsd_iterate_over_regset_sections): New.
(hppanbsd_init_abi): Adjust.
* hppaobsd-tdep.c (hppaobsd_regset_from_core_section): Remove.
(hppaobsd_iterate_over_regset_sections): New.
(hppaobsd_init_abi): Adjust.
---
gdb/hppa-hpux-tdep.c | 19 +++++++++----------
gdb/hppa-linux-tdep.c | 22 +++++++++++-----------
gdb/hppanbsd-tdep.c | 20 +++++++++-----------
gdb/hppaobsd-tdep.c | 24 ++++++++++--------------
4 files changed, 39 insertions(+), 46 deletions(-)
diff --git a/gdb/hppa-hpux-tdep.c b/gdb/hppa-hpux-tdep.c
index 688ac9a..ee59811 100644
--- a/gdb/hppa-hpux-tdep.c
+++ b/gdb/hppa-hpux-tdep.c
@@ -1371,15 +1371,14 @@ static const struct regset hppa_hpux_regset =
hppa_hpux_supply_save_state
};
-static const struct regset *
-hppa_hpux_regset_from_core_section (struct gdbarch *gdbarch,
- const char *sect_name, size_t sect_size)
+static void
+hppa_hpux_iterate_over_regset_sections (struct gdbarch *gdbarch,
+ iterate_over_regset_sections_cb *cb,
+ void *cb_data,
+ const struct regcache *regcache)
{
- if (strcmp (sect_name, ".reg") == 0
- && sect_size >= HPPA_HPUX_PA89_SAVE_STATE_SIZE + 8)
- return &hppa_hpux_regset;
-
- return NULL;
+ cb (".reg", HPPA_HPUX_PA89_SAVE_STATE_SIZE + 8, &hppa_hpux_regset,
+ NULL, cb_data);
}
\f
@@ -1495,8 +1494,8 @@ hppa_hpux_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch)
set_gdbarch_skip_permanent_breakpoint
(gdbarch, hppa_skip_permanent_breakpoint);
- set_gdbarch_regset_from_core_section
- (gdbarch, hppa_hpux_regset_from_core_section);
+ set_gdbarch_iterate_over_regset_sections
+ (gdbarch, hppa_hpux_iterate_over_regset_sections);
frame_unwind_append_unwinder (gdbarch, &hppa_hpux_sigtramp_frame_unwind);
}
diff --git a/gdb/hppa-linux-tdep.c b/gdb/hppa-linux-tdep.c
index 6bc604b..52837ee 100644
--- a/gdb/hppa-linux-tdep.c
+++ b/gdb/hppa-linux-tdep.c
@@ -472,17 +472,17 @@ static const struct regset hppa_linux_fpregset =
regcache_supply_regset, regcache_collect_regset
};
-static const struct regset *
-hppa_linux_regset_from_core_section (struct gdbarch *gdbarch,
- const char *sect_name,
- size_t sect_size)
+static void
+hppa_linux_iterate_over_regset_sections (struct gdbarch *gdbarch,
+ iterate_over_regset_sections_cb *cb,
+ void *cb_data,
+ const struct regcache *regcache)
{
- if (strcmp (sect_name, ".reg") == 0)
- return &hppa_linux_regset;
- else if (strcmp (sect_name, ".reg2") == 0)
- return &hppa_linux_fpregset;
+ struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch);
- return NULL;
+ cb (".reg", 80 * tdep->bytes_per_address, &hppa_linux_regset,
+ NULL, cb_data);
+ cb (".reg2", 64 * 4, &hppa_linux_fpregset, NULL, cb_data);
}
\f
@@ -520,8 +520,8 @@ hppa_linux_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch)
more work in gcc and glibc first. */
set_gdbarch_long_double_bit (gdbarch, 64);
- set_gdbarch_regset_from_core_section
- (gdbarch, hppa_linux_regset_from_core_section);
+ set_gdbarch_iterate_over_regset_sections
+ (gdbarch, hppa_linux_iterate_over_regset_sections);
set_gdbarch_dwarf2_reg_to_regnum (gdbarch, hppa_dwarf_reg_to_regnum);
diff --git a/gdb/hppanbsd-tdep.c b/gdb/hppanbsd-tdep.c
index b3f04c7..4587466 100644
--- a/gdb/hppanbsd-tdep.c
+++ b/gdb/hppanbsd-tdep.c
@@ -184,17 +184,15 @@ static const struct regset hppanbsd_gregset =
hppanbsd_supply_gregset
};
-/* Return the appropriate register set for the core section identified
- by SECT_NAME and SECT_SIZE. */
+/* Iterate over supported core file register note sections. */
-static const struct regset *
-hppanbsd_regset_from_core_section (struct gdbarch *gdbarch,
- const char *sect_name, size_t sect_size)
+static void
+hppanbsd_iterate_over_regset_sections (struct gdbarch *gdbarch,
+ iterate_over_regset_sections_cb *cb,
+ void *cb_data,
+ const struct regcache *regcache)
{
- if (strcmp (sect_name, ".reg") == 0 && sect_size >= HPPANBSD_SIZEOF_GREGS)
- return &hppanbsd_gregset;
-
- return NULL;
+ cb (".reg", HPPANBSD_SIZEOF_GREGS, &hppanbsd_gregset, NULL, cb_data);
}
\f
static void
@@ -204,8 +202,8 @@ hppanbsd_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch)
hppabsd_init_abi (info, gdbarch);
/* Core file support. */
- set_gdbarch_regset_from_core_section
- (gdbarch, hppanbsd_regset_from_core_section);
+ set_gdbarch_iterate_over_regset_sections
+ (gdbarch, hppanbsd_iterate_over_regset_sections);
tramp_frame_prepend_unwinder (gdbarch, &hppanbsd_sigtramp_si4);
}
diff --git a/gdb/hppaobsd-tdep.c b/gdb/hppaobsd-tdep.c
index c521359..3d2f217 100644
--- a/gdb/hppaobsd-tdep.c
+++ b/gdb/hppaobsd-tdep.c
@@ -140,20 +140,16 @@ static const struct regset hppaobsd_fpregset =
hppaobsd_supply_fpregset
};
-/* Return the appropriate register set for the core section identified
- by SECT_NAME and SECT_SIZE. */
+/* Iterate over supported core file register note sections. */
-static const struct regset *
-hppaobsd_regset_from_core_section (struct gdbarch *gdbarch,
- const char *sect_name, size_t sect_size)
+static void
+hppaobsd_iterate_over_regset_sections (struct gdbarch *gdbarch,
+ iterate_over_regset_sections_cb *cb,
+ void *cb_data,
+ const struct regcache *regcache)
{
- if (strcmp (sect_name, ".reg") == 0 && sect_size >= HPPAOBSD_SIZEOF_GREGS)
- return &hppaobsd_gregset;
-
- if (strcmp (sect_name, ".reg2") == 0 && sect_size >= HPPAOBSD_SIZEOF_FPREGS)
- return &hppaobsd_fpregset;
-
- return NULL;
+ cb (".reg", HPPAOBSD_SIZEOF_GREGS, &hppaobsd_gregset, NULL, cb_data);
+ cb (".reg2", HPPAOBSD_SIZEOF_FPREGS, &hppaobsd_fpregset, NULL, cb_data);
}
\f
@@ -164,8 +160,8 @@ hppaobsd_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch)
hppabsd_init_abi (info, gdbarch);
/* Core file support. */
- set_gdbarch_regset_from_core_section
- (gdbarch, hppaobsd_regset_from_core_section);
+ set_gdbarch_iterate_over_regset_sections
+ (gdbarch, hppaobsd_iterate_over_regset_sections);
}
\f
--
1.8.4.2
next prev parent reply other threads:[~2014-09-12 15:40 UTC|newest]
Thread overview: 37+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-09-12 15:40 [PATCH 00/26] Regset rework Andreas Arnez
2014-09-12 15:40 ` [PATCH 20/26] SPARC: Migrate from 'regset_from_core_section' to 'iterate_over_regset_sections' Andreas Arnez
2014-09-12 15:40 ` [PATCH 03/26] Add multi-arch capable 'fbsd_make_corefile_notes' variant Andreas Arnez
2014-09-12 15:40 ` [PATCH 06/26] ARM: Migrate from 'regset_from_core_section' to 'iterate_over_regset_sections' Andreas Arnez
2014-09-12 15:40 ` [PATCH 19/26] SH: " Andreas Arnez
2014-09-12 15:40 ` Andreas Arnez [this message]
2014-09-12 15:40 ` [PATCH 09/26] X86: " Andreas Arnez
2014-09-12 15:40 ` [PATCH 16/26] NIOS2: " Andreas Arnez
2014-09-12 15:40 ` [PATCH 04/26] AARCH64: " Andreas Arnez
2014-09-12 15:40 ` [PATCH 21/26] TILEGX: " Andreas Arnez
2014-09-12 15:40 ` [PATCH 12/26] IA64: " Andreas Arnez
2014-09-12 15:40 ` [PATCH 11/26] M68K: " Andreas Arnez
2014-09-12 15:40 ` [PATCH 17/26] PPC: " Andreas Arnez
2014-09-12 15:40 ` [PATCH 13/26] M88K: " Andreas Arnez
2014-09-12 15:40 ` [PATCH 07/26] FRV: " Andreas Arnez
2014-09-12 15:40 ` [PATCH 26/26] Drop 'regset_from_core_section' gdbarch method Andreas Arnez
2014-09-12 15:40 ` [PATCH 01/26] Replace 'core_regset_sections' by iterator method Andreas Arnez
2014-09-12 15:40 ` [PATCH 05/26] ALPHA: Migrate from 'regset_from_core_section' to 'iterate_over_regset_sections' Andreas Arnez
2014-09-12 15:40 ` [PATCH 22/26] VAX: " Andreas Arnez
2014-09-12 15:40 ` [PATCH 14/26] MIPS: " Andreas Arnez
2014-09-12 15:40 ` [PATCH 23/26] XTENSA: " Andreas Arnez
2014-09-12 16:14 ` [PATCH 02/26] Add 'regset' parameter to 'iterate_over_regset_sections_cb' Andreas Arnez
2014-09-12 16:15 ` [PATCH 10/26] M32R: Migrate from 'regset_from_core_section' to 'iterate_over_regset_sections' Andreas Arnez
2014-09-12 16:17 ` [PATCH 15/26] MN10300: " Andreas Arnez
2014-09-12 16:18 ` [PATCH 24/26] Drop target method 'fbsd_make_corefile_notes' Andreas Arnez
2014-09-12 16:18 ` [PATCH 25/26] Linux targets: drop fall back to target method for 'make_corefile_notes' Andreas Arnez
2014-09-12 16:18 ` [PATCH 18/26] SCORE: Migrate from 'regset_from_core_section' to 'iterate_over_regset_sections' Andreas Arnez
2014-09-12 18:31 ` [PATCH 25/26] Linux targets: drop fall back to target method for 'make_corefile_notes' Andreas Arnez
2014-09-12 18:31 ` [PATCH 24/26] Drop target method 'fbsd_make_corefile_notes' Andreas Arnez
2014-09-12 18:31 ` [PATCH 15/26] MN10300: Migrate from 'regset_from_core_section' to 'iterate_over_regset_sections' Andreas Arnez
2014-09-12 18:32 ` [PATCH 10/26] M32R: " Andreas Arnez
2014-09-12 18:32 ` [PATCH 18/26] SCORE: " Andreas Arnez
2014-09-12 18:32 ` [PATCH 02/26] Add 'regset' parameter to 'iterate_over_regset_sections_cb' Andreas Arnez
2014-09-22 17:15 ` [PATCH 00/26] Regset rework Ulrich Weigand
2014-09-26 16:20 ` Pedro Alves
2014-09-29 11:22 ` Ulrich Weigand
2014-09-30 7:59 ` 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=1410536396-25524-9-git-send-email-arnez@linux.vnet.ibm.com \
--to=arnez@linux.vnet.ibm.com \
--cc=gdb-patches@sourceware.org \
--cc=tausq@debian.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).