m32c: Split m32c_move_reg_t in read/write variants
authorSimon Marchi <simon.marchi@polymtl.ca>
Mon, 12 Oct 2015 16:39:40 +0000 (12:39 -0400)
committerSimon Marchi <simon.marchi@polymtl.ca>
Mon, 12 Oct 2015 16:39:40 +0000 (12:39 -0400)
commit6da660c76dd7c2998d847d2c978a293f13105eea
treefd0059ff0b27e7a49b736c6169ff708430101cad
parent1f713e48f024e964f5a4f5468bc9506dac262763
m32c: Split m32c_move_reg_t in read/write variants

This allows to avoid casting away the const qualification in
m32c_pseudo_register_write (which is the entry points for all other
register read/write functions).

Also, use gdb_byte* instead of void* to avoid casts when calling gdb
common memory functions.  It also allows to remove those "For adderss
arithmetic" local variables.

gdb/ChangeLog:

* m32c-tdep.c (m32c_move_reg_t): Replace with...
(m32c_write_reg_t): ...this and...
(m32c_read_reg_t): ...this.
(struct m32c_reg): Update types of read and write.
(m32c_raw_read): Change declaration type to m32c_read_reg_t and
adjust definition.
(m32c_banked_read): Likewise.
(m32c_sb_read): Likewise.
(m32c_part_read): Likewise.
(m32c_cat_read): Likewise.
(m32c_r3r2r1r0_read): Likewise.
(m32c_raw_write): Change declaration type to m32c_write_reg_t
and adjust definition.
(m32c_banked_write): Likewise.
(m32c_sb_write): Likewise.
(m32c_part_write): Likewise.
(m32c_cat_write): Likewise.
(m32c_r3r2r1r0_write): Likewise.
gdb/ChangeLog
gdb/m32c-tdep.c