aboutsummaryrefslogtreecommitdiff
path: root/gdb/m32r-linux-nat.c
diff options
context:
space:
mode:
Diffstat (limited to 'gdb/m32r-linux-nat.c')
-rw-r--r--gdb/m32r-linux-nat.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/gdb/m32r-linux-nat.c b/gdb/m32r-linux-nat.c
index 86b20bd..2b17aad 100644
--- a/gdb/m32r-linux-nat.c
+++ b/gdb/m32r-linux-nat.c
@@ -80,19 +80,23 @@ supply_gregset (elf_gregset_t * gregsetp)
for (i = 0; i < M32R_LINUX_NUM_REGS; i++)
{
+ elf_greg_t regval;
+
switch (i)
{
case PSW_REGNUM:
- *(regp + regmap[i]) =
- ((0x00c1 & bbpsw) << 8) | ((0xc100 & psw) >> 8);
+ regval = ((0x00c1 & bbpsw) << 8) | ((0xc100 & psw) >> 8);
break;
case CBR_REGNUM:
- *(regp + regmap[i]) = ((psw >> 8) & 1);
+ regval = ((psw >> 8) & 1);
+ break;
+ default:
+ regval = *(regp + regmap[i]);
break;
}
if (i != M32R_SP_REGNUM)
- regcache_raw_supply (current_regcache, i, regp + regmap[i]);
+ regcache_raw_supply (current_regcache, i, &regval);
else if (psw & 0x8000)
regcache_raw_supply (current_regcache, i, regp + SPU_REGMAP);
else