diff --git a/gdb/ChangeLog b/gdb/ChangeLog index ad32672110..dc0cee52c3 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,8 @@ +2014-08-07 Andreas Arnez + + * nios2-linux-tdep.c (nios2_collect_gregset): New function. + (nios2_core_regset): Add collect method. + 2014-08-07 Andreas Arnez * m32r-linux-tdep.c (m32r_linux_supply_gregset): Make diff --git a/gdb/nios2-linux-tdep.c b/gdb/nios2-linux-tdep.c index b2a3c3e20a..b9ee922038 100644 --- a/gdb/nios2-linux-tdep.c +++ b/gdb/nios2-linux-tdep.c @@ -71,11 +71,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. */