From 146e6c5cc7b19ea56a033415511e38a2d0656e42 Mon Sep 17 00:00:00 2001 From: Alan Hayward Date: Mon, 8 May 2017 09:35:45 +0100 Subject: [PATCH] Remove some uses of MAX_REGISTER_SIZE uses from mn10300-linux-tdep.c gdb/ * mn10300-linux-tdep.c (am33_supply_gregset_method): Use regcache->raw_supply_zeroed. --- gdb/ChangeLog | 5 +++++ gdb/mn10300-linux-tdep.c | 17 +++++------------ 2 files changed, 10 insertions(+), 12 deletions(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 1f2f6385cfb..8979e759bb3 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,8 @@ +2017-05-08 Alan Hayward + + * mn10300-linux-tdep.c (am33_supply_gregset_method): Use + regcache->raw_supply_zeroed. + 2017-05-06 Sergio Durigan Junior * configure.nat: Rearrange 'case' statements to match diff --git a/gdb/mn10300-linux-tdep.c b/gdb/mn10300-linux-tdep.c index 8c23f02b2b5..44707e8e241 100644 --- a/gdb/mn10300-linux-tdep.c +++ b/gdb/mn10300-linux-tdep.c @@ -86,7 +86,6 @@ am33_supply_gregset_method (const struct regset *regset, struct regcache *regcache, int regnum, const void *gregs, size_t len) { - char zerobuf[MAX_REGISTER_SIZE]; const mn10300_elf_greg_t *regp = (const mn10300_elf_greg_t *) gregs; int i; @@ -188,17 +187,13 @@ am33_supply_gregset_method (const struct regset *regset, /* ssp, msp, and usp are inaccessible. */ case E_E8_REGNUM: - memset (zerobuf, 0, MAX_REGISTER_SIZE); - regcache_raw_supply (regcache, E_E8_REGNUM, zerobuf); + regcache->raw_supply_zeroed (E_E8_REGNUM); break; case E_E9_REGNUM: - memset (zerobuf, 0, MAX_REGISTER_SIZE); - regcache_raw_supply (regcache, E_E9_REGNUM, zerobuf); + regcache->raw_supply_zeroed (E_E9_REGNUM); break; case E_E10_REGNUM: - memset (zerobuf, 0, MAX_REGISTER_SIZE); - regcache_raw_supply (regcache, E_E10_REGNUM, zerobuf); - + regcache->raw_supply_zeroed (E_E10_REGNUM); break; case E_MCRH_REGNUM: regcache_raw_supply (regcache, E_MCRH_REGNUM, @@ -218,12 +213,10 @@ am33_supply_gregset_method (const struct regset *regset, break; case E_FPCR_REGNUM + 1: /* The two unused registers beyond fpcr are inaccessible. */ - memset (zerobuf, 0, MAX_REGISTER_SIZE); - regcache_raw_supply (regcache, E_FPCR_REGNUM + 1, zerobuf); + regcache->raw_supply_zeroed (E_FPCR_REGNUM + 1); break; case E_FPCR_REGNUM + 2: - memset (zerobuf, 0, MAX_REGISTER_SIZE); - regcache_raw_supply (regcache, E_FPCR_REGNUM + 2, zerobuf); + regcache->raw_supply_zeroed (E_FPCR_REGNUM + 2); break; default: /* An error, obviously, but should we error out? */ break; -- 2.30.2