]> git.ipfire.org Git - thirdparty/binutils-gdb.git/blobdiff - gdb/bfin-tdep.c
gdb/
[thirdparty/binutils-gdb.git] / gdb / bfin-tdep.c
index 7de0b1be8bdecabb4ad05e5eda675301839b4a5c..8c0cb5a325be4d7974905a223a7f9621895fbd85 100644 (file)
@@ -689,20 +689,25 @@ bfin_register_name (struct gdbarch *gdbarch, int i)
   return bfin_register_name_strings[i];
 }
 
-static void
+static enum register_status
 bfin_pseudo_register_read (struct gdbarch *gdbarch, struct regcache *regcache,
                           int regnum, gdb_byte *buffer)
 {
   gdb_byte *buf = (gdb_byte *) alloca (MAX_REGISTER_SIZE);
+  enum register_status status;
 
   if (regnum != BFIN_CC_REGNUM)
     internal_error (__FILE__, __LINE__,
                    _("invalid register number %d"), regnum);
 
   /* Extract the CC bit from the ASTAT register.  */
-  regcache_raw_read (regcache, BFIN_ASTAT_REGNUM, buf);
-  buffer[1] = buffer[2] = buffer[3] = 0;
-  buffer[0] = !!(buf[0] & ASTAT_CC);
+  status = regcache_raw_read (regcache, BFIN_ASTAT_REGNUM, buf);
+  if (status == REG_VALID)
+    {
+      buffer[1] = buffer[2] = buffer[3] = 0;
+      buffer[0] = !!(buf[0] & ASTAT_CC);
+    }
+  return status;
 }
 
 static void