This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
[PATCH v3 09/13] NIOS2 Linux: Fill 'collect_regset' in regset structure.
- From: Andreas Arnez <arnez at linux dot vnet dot ibm dot com>
- To: gdb-patches at sourceware dot org
- Cc: Yao Qi <yao at codesourcery dot com>
- Date: Thu, 31 Jul 2014 13:04:42 +0200
- Subject: [PATCH v3 09/13] NIOS2 Linux: Fill 'collect_regset' in regset structure.
- Authentication-results: sourceware.org; auth=none
- References: <1406804686-9437-1-git-send-email-arnez at linux dot vnet dot ibm dot com>
gdb/
* nios2-linux-tdep.c (nios2_collect_gregset): New function.
(nios2_core_regset): Add collect method.
---
gdb/nios2-linux-tdep.c | 21 ++++++++++++++++++++-
1 file changed, 20 insertions(+), 1 deletion(-)
diff --git a/gdb/nios2-linux-tdep.c b/gdb/nios2-linux-tdep.c
index 84ab576..0f53477 100644
--- a/gdb/nios2-linux-tdep.c
+++ b/gdb/nios2-linux-tdep.c
@@ -73,11 +73,30 @@ nios2_supply_gregset (const struct regset *regset,
}
}
+/* Implement the collect_regset hook for core files. */
+
+static void
+nios2_collect_gregset (const struct regset *regset,
+ const struct regcache *regcache,
+ int regnum, void *gregs_buf, size_t len)
+{
+ gdb_byte *gregs = gregs_buf;
+ int regno;
+
+ for (regno = NIOS2_Z_REGNUM; regno <= NIOS2_MPUACC_REGNUM; regno++)
+ if (regnum == -1 || regnum == regno)
+ {
+ if (reg_offsets[regno] != -1)
+ regcache_raw_collect (regcache, regno,
+ gregs + 4 * reg_offsets[regno]);
+ }
+}
+
static const struct regset nios2_core_regset =
{
NULL,
nios2_supply_gregset,
- NULL,
+ nios2_collect_gregset
};
/* Implement the regset_from_core_section gdbarch method. */
--
1.8.4.2