aboutsummaryrefslogtreecommitdiff
path: root/gdb/dummy-frame.c
diff options
context:
space:
mode:
authorYao Qi <yao.qi@linaro.org>2018-02-21 11:20:03 +0000
committerYao Qi <yao.qi@linaro.org>2018-02-21 11:20:03 +0000
commitdaf6667d1f94c7e74df4076daf021cd28a2797b6 (patch)
treec3cdc9beab7cb79439034a2c1b209e5e99e1826f /gdb/dummy-frame.c
parentfc5b87361580d915e28ae5f3cc4794b75b671b5a (diff)
downloadgdb-daf6667d1f94c7e74df4076daf021cd28a2797b6.zip
gdb-daf6667d1f94c7e74df4076daf021cd28a2797b6.tar.gz
gdb-daf6667d1f94c7e74df4076daf021cd28a2797b6.tar.bz2
Class readonly_detached_regcache
This patch adds a new class (type) for readonly regcache, which is created via regcache::save. readonly_detached_regcache inherits readable_regcache. gdb: 2018-02-21 Yao Qi <yao.qi@linaro.org> * dummy-frame.c (dummy_frame_cache) <prev_regcache>: Use readonly_detached_regcache. (dummy_frame_prev_register): Use regcache->cooked_read. * frame.c (frame_save_as_regcache): Change return type. (frame_pop): Update. * frame.h (frame_save_as_regcache): Update declaration. * inferior.h (get_infcall_suspend_state_regcache): Update declaration. * infrun.c (infcall_suspend_state) <registers>: use readonly_detached_regcache. (save_infcall_suspend_state): Don't use regcache_dup. (get_infcall_suspend_state_regcache): Change return type. * linux-fork.c (struct fork_info) <savedregs>: Change to readonly_detached_regcache. <pc>: New field. (fork_save_infrun_state): Don't use regcache_dup. (info_checkpoints_command): Adjust. * mi/mi-main.c (register_changed_p): Update declaration. (mi_cmd_data_list_changed_registers): Use readonly_detached_regcache. (register_changed_p): Change parameter type to readonly_detached_regcache. * ppc-linux-tdep.c (ppu2spu_cache) <regcache>: Use readonly_detached_regcache. (ppu2spu_sniffer): Construct a new readonly_detached_regcache. * regcache.c (readonly_detached_regcache::readonly_detached_regcache): New. (regcache::save): Move it to reg_buffer. (regcache::restore): Change parameter type. (regcache_dup): Remove. * regcache.h (reg_buffer) <save>: New method. (readonly_detached_regcache): New class. * spu-tdep.c (spu2ppu_cache) <regcache>: Use readonly_detached_regcache. (spu2ppu_sniffer): Construct a new readonly_detached_regcache.
Diffstat (limited to 'gdb/dummy-frame.c')
-rw-r--r--gdb/dummy-frame.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/gdb/dummy-frame.c b/gdb/dummy-frame.c
index db8ba1b..a67033e 100644
--- a/gdb/dummy-frame.c
+++ b/gdb/dummy-frame.c
@@ -282,7 +282,7 @@ cleanup_dummy_frames (struct target_ops *target, int from_tty)
struct dummy_frame_cache
{
struct frame_id this_id;
- struct regcache *prev_regcache;
+ readonly_detached_regcache *prev_regcache;
};
static int
@@ -352,8 +352,8 @@ dummy_frame_prev_register (struct frame_info *this_frame,
/* Use the regcache_cooked_read() method so that it, on the fly,
constructs either a raw or pseudo register from the raw
register cache. */
- regcache_cooked_read (cache->prev_regcache, regnum,
- value_contents_writeable (reg_val));
+ cache->prev_regcache->cooked_read (regnum,
+ value_contents_writeable (reg_val));
return reg_val;
}