From 845b344fd54ba381a826b271dd33682d1f148438 Mon Sep 17 00:00:00 2001 From: Alan Hayward Date: Mon, 10 Apr 2017 15:01:53 +0100 Subject: [PATCH] msp430: Don't use REG_UNKNOWN gdb/ * msp430-tdep.c (msp430_pseudo_register_read): Never return REG_UNKNOWN. --- gdb/ChangeLog | 5 +++++ gdb/msp430-tdep.c | 6 ++---- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 68d8f34a270..3cb6cd73592 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,8 @@ +2017-04-10 Alan Hayward + + * msp430-tdep.c (msp430_pseudo_register_read): Never return + REG_UNKNOWN. + 2017-04-10 Yao Qi PR gdb/19942 diff --git a/gdb/msp430-tdep.c b/gdb/msp430-tdep.c index 75329dfcc5e..d9eebf0cc26 100644 --- a/gdb/msp430-tdep.c +++ b/gdb/msp430-tdep.c @@ -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. */ -- 2.30.2