aboutsummaryrefslogtreecommitdiff
path: root/gdb
diff options
context:
space:
mode:
authorAlan Hayward <alan.hayward@arm.com>2017-05-08 09:37:26 +0100
committerAlan Hayward <alan.hayward@arm.com>2017-05-08 09:37:26 +0100
commit27bfc1d1c2cbcafccddef51ef82b309ef147c4a8 (patch)
treecebef1343cea775dc2f0bcd02cadd9f6d08e070c /gdb
parent146e6c5cc7b19ea56a033415511e38a2d0656e42 (diff)
downloadbinutils-27bfc1d1c2cbcafccddef51ef82b309ef147c4a8.zip
binutils-27bfc1d1c2cbcafccddef51ef82b309ef147c4a8.tar.gz
binutils-27bfc1d1c2cbcafccddef51ef82b309ef147c4a8.tar.bz2
Remove some uses of MAX_REGISTER_SIZE from mips-linux-tdep.c
gdb/ * mips-linux-tdep.c (mips_supply_gregset): Use raw_supply_zeroed. (mips_supply_fpregset): Likewise. (mips64_supply_gregset): Likewise.
Diffstat (limited to 'gdb')
-rw-r--r--gdb/ChangeLog6
-rw-r--r--gdb/mips-linux-tdep.c18
2 files changed, 10 insertions, 14 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 8979e75..1f3f6cb 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,5 +1,11 @@
2017-05-08 Alan Hayward <alan.hayward@arm.com>
+ * mips-linux-tdep.c (mips_supply_gregset): Use raw_supply_zeroed.
+ (mips_supply_fpregset): Likewise.
+ (mips64_supply_gregset): Likewise.
+
+2017-05-08 Alan Hayward <alan.hayward@arm.com>
+
* mn10300-linux-tdep.c (am33_supply_gregset_method): Use
regcache->raw_supply_zeroed.
diff --git a/gdb/mips-linux-tdep.c b/gdb/mips-linux-tdep.c
index 57e75b5..48a582a 100644
--- a/gdb/mips-linux-tdep.c
+++ b/gdb/mips-linux-tdep.c
@@ -133,11 +133,8 @@ mips_supply_gregset (struct regcache *regcache,
{
int regi;
const mips_elf_greg_t *regp = *gregsetp;
- char zerobuf[MAX_REGISTER_SIZE];
struct gdbarch *gdbarch = get_regcache_arch (regcache);
- memset (zerobuf, 0, MAX_REGISTER_SIZE);
-
for (regi = EF_REG0 + 1; regi <= EF_REG31; regi++)
supply_32bit_reg (regcache, regi - EF_REG0, regp + regi);
@@ -156,7 +153,7 @@ mips_supply_gregset (struct regcache *regcache,
regp + EF_CP0_CAUSE);
/* Fill the inaccessible zero register with zero. */
- regcache_raw_supply (regcache, MIPS_ZERO_REGNUM, zerobuf);
+ regcache->raw_supply_zeroed (MIPS_ZERO_REGNUM);
}
static void
@@ -245,9 +242,6 @@ mips_supply_fpregset (struct regcache *regcache,
{
struct gdbarch *gdbarch = get_regcache_arch (regcache);
int regi;
- char zerobuf[MAX_REGISTER_SIZE];
-
- memset (zerobuf, 0, MAX_REGISTER_SIZE);
for (regi = 0; regi < 32; regi++)
regcache_raw_supply (regcache,
@@ -259,9 +253,8 @@ mips_supply_fpregset (struct regcache *regcache,
*fpregsetp + 32);
/* FIXME: how can we supply FCRIR? The ABI doesn't tell us. */
- regcache_raw_supply (regcache,
- mips_regnum (gdbarch)->fp_implementation_revision,
- zerobuf);
+ regcache->raw_supply_zeroed
+ (mips_regnum (gdbarch)->fp_implementation_revision);
}
static void
@@ -379,11 +372,8 @@ mips64_supply_gregset (struct regcache *regcache,
{
int regi;
const mips64_elf_greg_t *regp = *gregsetp;
- gdb_byte zerobuf[MAX_REGISTER_SIZE];
struct gdbarch *gdbarch = get_regcache_arch (regcache);
- memset (zerobuf, 0, MAX_REGISTER_SIZE);
-
for (regi = MIPS64_EF_REG0 + 1; regi <= MIPS64_EF_REG31; regi++)
supply_64bit_reg (regcache, regi - MIPS64_EF_REG0,
(const gdb_byte *) (regp + regi));
@@ -407,7 +397,7 @@ mips64_supply_gregset (struct regcache *regcache,
(const gdb_byte *) (regp + MIPS64_EF_CP0_CAUSE));
/* Fill the inaccessible zero register with zero. */
- regcache_raw_supply (regcache, MIPS_ZERO_REGNUM, zerobuf);
+ regcache->raw_supply_zeroed (MIPS_ZERO_REGNUM);
}
static void