diff options
author | Andreas Arnez <arnez@linux.vnet.ibm.com> | 2014-04-01 07:08:11 +0000 |
---|---|---|
committer | Ulrich Weigand <ulrich.weigand@de.ibm.com> | 2014-08-07 17:31:49 +0200 |
commit | 81580573ba47d0047d76d4fddabe150b49ee3b54 (patch) | |
tree | 16c605757ebd3f3539c65b48cc47eccd07373077 /gdb/nios2-linux-tdep.c | |
parent | ba199d7d3b21c201d73cdbf108b41f62c9b18ab0 (diff) | |
download | gdb-81580573ba47d0047d76d4fddabe150b49ee3b54.zip gdb-81580573ba47d0047d76d4fddabe150b49ee3b54.tar.gz gdb-81580573ba47d0047d76d4fddabe150b49ee3b54.tar.bz2 |
NIOS2 Linux: Fill 'collect_regset' in regset structure.
Diffstat (limited to 'gdb/nios2-linux-tdep.c')
-rw-r--r-- | gdb/nios2-linux-tdep.c | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/gdb/nios2-linux-tdep.c b/gdb/nios2-linux-tdep.c index b2a3c3e..b9ee922 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. */ |