+2018-06-09 Simon Marchi <simon.marchi@ericsson.com>
+
+ * common/common-regcache.h (enum register_status): Add
+ underlying type "signed char".
+ * regcache.h (reg_buffer) <m_register_status>: Change type to
+ register_status *.
+ * regcache.c (reg_buffer::reg_buffer): Alocate arrays of
+ register_status instead of signed char.
+ (reg_buffer::save): Use REG_UNKNOWN instead of 0.
+ (reg_buffer::get_register_status): Remove cast.
+ (readable_regcache::raw_read): Remove cast.
+ (readable_regcache::cooked_read): Remove cast.
+
2018-06-09 Tom Tromey <tom@tromey.com>
* source.c (reverse_search_command, forward_search_command): Use
if (has_pseudo)
{
m_registers = XCNEWVEC (gdb_byte, m_descr->sizeof_cooked_registers);
- m_register_status = XCNEWVEC (signed char,
- m_descr->nr_cooked_registers);
+ m_register_status
+ = XCNEWVEC (register_status, m_descr->nr_cooked_registers);
}
else
{
m_registers = XCNEWVEC (gdb_byte, m_descr->sizeof_raw_registers);
- m_register_status = XCNEWVEC (signed char, gdbarch_num_regs (gdbarch));
+ m_register_status
+ = XCNEWVEC (register_status, gdbarch_num_regs (gdbarch));
}
}
gdb_assert (m_has_pseudo);
/* Clear the dest. */
memset (m_registers, 0, m_descr->sizeof_cooked_registers);
- memset (m_register_status, 0, m_descr->nr_cooked_registers);
+ memset (m_register_status, REG_UNKNOWN, m_descr->nr_cooked_registers);
/* Copy over any registers (identified by their membership in the
save_reggroup) and mark them as valid. The full [0 .. gdbarch_num_regs +
gdbarch_num_pseudo_regs) range is checked since some architectures need
{
assert_regnum (regnum);
- return (enum register_status) m_register_status[regnum];
+ return m_register_status[regnum];
}
void
memcpy (buf, register_buffer (regnum),
m_descr->sizeof_register[regnum]);
- return (enum register_status) m_register_status[regnum];
+ return m_register_status[regnum];
}
enum register_status
else
memset (buf, 0, m_descr->sizeof_register[regnum]);
- return (enum register_status) m_register_status[regnum];
+ return m_register_status[regnum];
}
else if (gdbarch_pseudo_register_read_value_p (m_descr->gdbarch))
{