aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Arnez <arnez@linux.vnet.ibm.com>2014-09-02 14:00:44 +0000
committerAndreas Krebbel <krebbel@linux.vnet.ibm.com>2014-09-30 09:14:37 +0200
commitc5b8d704bc8cf2fa2c6f23cbdb57c935550e6a6a (patch)
treea272c2bc42db01f31c3590345165de3701786304
parent3636e6083c1dc792e2fe0142f45e9f86cc593528 (diff)
downloadgdb-c5b8d704bc8cf2fa2c6f23cbdb57c935550e6a6a.zip
gdb-c5b8d704bc8cf2fa2c6f23cbdb57c935550e6a6a.tar.gz
gdb-c5b8d704bc8cf2fa2c6f23cbdb57c935550e6a6a.tar.bz2
NIOS2: Migrate from 'regset_from_core_section' to 'iterate_over_regset_sections'
For Nios II GNU/Linux targets, no longer define the gdbarch method 'regset_from_core_section', but the iterator method instead. gdb/ChangeLog: * nios2-linux-tdep.c (NIOS2_GREGS_SIZE): New macro. (nios2_regset_from_core_section): Remove. (nios2_iterate_over_regset_sections): New. (nios2_linux_init_abi): Adjust gdbarch initialization.
-rw-r--r--gdb/ChangeLog7
-rw-r--r--gdb/nios2-linux-tdep.c24
2 files changed, 21 insertions, 10 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 8bd3276..1610613 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,5 +1,12 @@
2014-09-30 Andreas Arnez <arnez@linux.vnet.ibm.com>
+ * nios2-linux-tdep.c (NIOS2_GREGS_SIZE): New macro.
+ (nios2_regset_from_core_section): Remove.
+ (nios2_iterate_over_regset_sections): New.
+ (nios2_linux_init_abi): Adjust gdbarch initialization.
+
+2014-09-30 Andreas Arnez <arnez@linux.vnet.ibm.com>
+
* mn10300-linux-tdep.c (am33_regset_from_core_section): Remove.
(am33_iterate_over_regset_sections): New.
(am33_linux_init_osabi): Adjust gdbarch initialization.
diff --git a/gdb/nios2-linux-tdep.c b/gdb/nios2-linux-tdep.c
index b9ee922..95098ea 100644
--- a/gdb/nios2-linux-tdep.c
+++ b/gdb/nios2-linux-tdep.c
@@ -49,6 +49,11 @@ static const int reg_offsets[NIOS2_NUM_REGS] =
-1, -1, -1, -1, -1, -1, -1, -1
};
+/* General register set size. Should match sizeof (struct pt_regs) +
+ sizeof (struct switch_stack) from the NIOS2 Linux kernel patch. */
+
+#define NIOS2_GREGS_SIZE (4 * 34)
+
/* Implement the supply_regset hook for core files. */
static void
@@ -97,16 +102,15 @@ static const struct regset nios2_core_regset =
nios2_collect_gregset
};
-/* Implement the regset_from_core_section gdbarch method. */
+/* Iterate over core file register note sections. */
-static const struct regset *
-nios2_regset_from_core_section (struct gdbarch *gdbarch,
- const char *sect_name, size_t sect_size)
+static void
+nios2_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 &nios2_core_regset;
-
- return NULL;
+ cb (".reg", NIOS2_GREGS_SIZE, &nios2_core_regset, NULL, cb_data);
}
/* Initialize a trad-frame cache corresponding to the tramp-frame.
@@ -181,8 +185,8 @@ nios2_linux_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch)
set_gdbarch_fetch_tls_load_module_address (gdbarch,
svr4_fetch_objfile_link_map);
/* Core file support. */
- set_gdbarch_regset_from_core_section (gdbarch,
- nios2_regset_from_core_section);
+ set_gdbarch_iterate_over_regset_sections
+ (gdbarch, nios2_iterate_over_regset_sections);
/* Linux signal frame unwinders. */
tramp_frame_prepend_unwinder (gdbarch,
&nios2_linux_rt_sigreturn_tramp_frame);