msp430: Don't use REG_UNKNOWN
authorAlan Hayward <alan.hayward@arm.com>
Mon, 10 Apr 2017 14:01:53 +0000 (15:01 +0100)
committerAlan Hayward <alan.hayward@arm.com>
Mon, 10 Apr 2017 14:01:53 +0000 (15:01 +0100)
gdb/
* msp430-tdep.c (msp430_pseudo_register_read): Never return
REG_UNKNOWN.

gdb/ChangeLog
gdb/msp430-tdep.c

index 68d8f34a270aa3e3e165f5ee3c320ef8233545ea..3cb6cd735922cf4acd604123b3361f59d9c99048 100644 (file)
@@ -1,3 +1,8 @@
+2017-04-10  Alan Hayward  <alan.hayward@arm.com>
+
+       * msp430-tdep.c (msp430_pseudo_register_read): Never return
+       REG_UNKNOWN.
+
 2017-04-10  Yao Qi  <yao.qi@linaro.org>
 
        PR gdb/19942
index 75329dfcc5ed94fff19639db4db21dd0874d0e96..d9eebf0cc2647a079db2f822145d0fb74ea301e4 100644 (file)
@@ -221,10 +221,9 @@ msp430_pseudo_register_read (struct gdbarch *gdbarch,
                             struct regcache *regcache,
                             int regnum, gdb_byte *buffer)
 {
-  enum register_status status = REG_UNKNOWN;
-
   if (MSP430_NUM_REGS <= regnum && regnum < MSP430_NUM_TOTAL_REGS)
     {
+      enum register_status status;
       ULONGEST val;
       enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
       int regsize = register_size (gdbarch, regnum);
@@ -234,11 +233,10 @@ msp430_pseudo_register_read (struct gdbarch *gdbarch,
       if (status == REG_VALID)
        store_unsigned_integer (buffer, regsize, byte_order, val);
 
+      return status;
     }
   else
     gdb_assert_not_reached ("invalid pseudo register number");
-
-  return status;
 }
 
 /* Implement the "pseudo_register_write" gdbarch method.  */