From: Alan Hayward Date: Mon, 8 May 2017 08:37:26 +0000 (+0100) Subject: Remove some uses of MAX_REGISTER_SIZE from mips-linux-tdep.c X-Git-Tag: binutils-2_29~578 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=27bfc1d1c2cbcafccddef51ef82b309ef147c4a8;p=external%2Fbinutils.git 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. --- 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 + * mips-linux-tdep.c (mips_supply_gregset): Use raw_supply_zeroed. + (mips_supply_fpregset): Likewise. + (mips64_supply_gregset): Likewise. + +2017-05-08 Alan Hayward + * 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