diff options
Diffstat (limited to 'gdb/bfin-tdep.c')
-rw-r--r-- | gdb/bfin-tdep.c | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/gdb/bfin-tdep.c b/gdb/bfin-tdep.c index 7de0b1b..8c0cb5a 100644 --- a/gdb/bfin-tdep.c +++ b/gdb/bfin-tdep.c @@ -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 |