aboutsummaryrefslogtreecommitdiff
path: root/gdb/target.c
diff options
context:
space:
mode:
authorYao Qi <yao.qi@linaro.org>2017-04-28 22:48:42 +0100
committerYao Qi <yao.qi@linaro.org>2017-04-28 22:48:42 +0100
commitef79d9a3c6ed1e3ccd466bae76956019a7c5d376 (patch)
treeec81a8a4cd56450f3797bd60cd36303fe8cd291f /gdb/target.c
parentf8fdb78eafb3f70661f6e4a43beb004dde9e0921 (diff)
downloadgdb-ef79d9a3c6ed1e3ccd466bae76956019a7c5d376.zip
gdb-ef79d9a3c6ed1e3ccd466bae76956019a7c5d376.tar.gz
gdb-ef79d9a3c6ed1e3ccd466bae76956019a7c5d376.tar.bz2
Class-fy regcache
This patch moves regcache declaration to regcache.h, and converts regcache apis to member functions, for example, regcache_invalidate is changed to regcache::invalidate. This patch also add "m_" prefix to these private fields. gdb: 2017-04-28 Yao Qi <yao.qi@linaro.org> * regcache.c (struct regcache): Move to regcache.h (regcache::arch): New method. (regcache_get_ptid): Update. (get_regcache_arch): Call arch method. (get_regcache_aspace): Call method aspace. (register_buffer): Change it to method. (regcache_save): Change it to regcache::save. (regcache_restore): Likewise. (regcache_cpy_no_passthrough): Remove the declaration. (regcache_cpy): Call methods restore and cpy_no_passthrough. (regcache_cpy_no_passthrough): Change it to method cpy_no_passthrough. (regcache_register_status): Change it to method get_register_status. (regcache_invalidate): Change it to method invalidate. (regcache_thread_ptid_changed): Use methods ptid and set_ptid. (regcache_raw_update): Change it to method raw_update. (regcache_raw_read): Likewise. (regcache_raw_read_signed): Likewise. (regcache_raw_read_unsigned): Likewise. (regcache_raw_write_signed): Likewise. (regcache_raw_write_unsigned): Likewise. (regcache_cooked_read): Likewise. (regcache_cooked_read_value): Likewise. (regcache_cooked_read_signed): Likewise. (regcache_cooked_read_unsigned): Likewise. (regcache_cooked_write_signed): Likewise. (regcache_cooked_write_unsigned): Likewise. (regcache_raw_set_cached_value): Likewise. (regcache_raw_write): Likewise. (regcache_cooked_write): Likewise. (regcache_xfer_part): Likewise. (regcache_raw_read_part): Likewise. (regcache_raw_write_part): Likewise. (regcache_cooked_read_part): Likewise. (regcache_cooked_write_part): Likewise. (regcache_raw_supply): Likewise. (regcache_raw_collect): Likewise. (regcache_transfer_regset): Likewise. (regcache_supply_regset): Likewise. (regcache_collect_regset): Likewise. (regcache_debug_print_register): Likewise. (enum regcache_dump_what): Move it to regcache.h. (regcache_dump): Change it to method dump. * regcache.h (enum regcache_dump_what): New. (class regcache): New. * target.c (target_fetch_registers): Call method debug_print_register. (target_store_registers): Likewise.
Diffstat (limited to 'gdb/target.c')
-rw-r--r--gdb/target.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/gdb/target.c b/gdb/target.c
index 10a5315..e526bcc 100644
--- a/gdb/target.c
+++ b/gdb/target.c
@@ -3552,7 +3552,7 @@ target_fetch_registers (struct regcache *regcache, int regno)
{
current_target.to_fetch_registers (&current_target, regcache, regno);
if (targetdebug)
- regcache_debug_print_register ("target_fetch_registers", regcache, regno);
+ regcache->debug_print_register ("target_fetch_registers", regno);
}
void
@@ -3564,8 +3564,7 @@ target_store_registers (struct regcache *regcache, int regno)
current_target.to_store_registers (&current_target, regcache, regno);
if (targetdebug)
{
- regcache_debug_print_register ("target_store_registers", regcache,
- regno);
+ regcache->debug_print_register ("target_store_registers", regno);
}
}