Change type of reg_buffer::m_register_status to register_status

The type of reg_buffer::m_register_status is an array of signed char,
probably to ensure that each element takes up only one byte.  Instead,
since we use C++11, we can force the underlying type of register_status
to be signed char and use the enum type.

gdb/ChangeLog:

	* 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.
This commit is contained in:
Simon Marchi
2018-06-09 22:08:06 -04:00
committed by Simon Marchi
parent 09897e3330
commit aac0d564ce
4 changed files with 23 additions and 9 deletions

View File

@ -177,7 +177,7 @@ protected:
/* The register buffers. */
gdb_byte *m_registers;
/* Register cache status. */
signed char *m_register_status;
register_status *m_register_status;
friend class regcache;
friend class detached_regcache;