Automatic date update in version.in
[deliverable/binutils-gdb.git] / gdb / aarch32-linux-nat.c
index 72bf644a3ed8e3fd9b7521503e1ea564b2e992c4..2df672df6c9a202aff2eff5b0340f8508f3b42a5 100644 (file)
@@ -67,8 +67,15 @@ aarch32_gp_regcache_collect (const struct regcache *regcache, uint32_t *regs,
 
   if (arm_apcs_32
       && REG_VALID == regcache_register_status (regcache, ARM_PS_REGNUM))
-    regcache_raw_collect (regcache, ARM_PS_REGNUM,
-                         &regs[ARM_CPSR_GREGNUM]);
+    {
+      uint32_t cpsr = regs[ARM_CPSR_GREGNUM];
+
+      regcache_raw_collect (regcache, ARM_PS_REGNUM,
+                           &regs[ARM_CPSR_GREGNUM]);
+      /* Keep reserved bits bit 20 to bit 23.  */
+      regs[ARM_CPSR_GREGNUM] = ((regs[ARM_CPSR_GREGNUM] & 0xff0fffff)
+                               | (cpsr & 0x00f00000));
+    }
 }
 
 /* Supply VFP registers contents, stored in REGS, to REGCACHE.
This page took 0.023426 seconds and 4 git commands to generate.