diff options
author | Yao Qi <yao.qi@linaro.org> | 2018-02-21 11:20:03 +0000 |
---|---|---|
committer | Yao Qi <yao.qi@linaro.org> | 2018-02-21 11:20:03 +0000 |
commit | 215c69dc9a7d8f868198b5523abcf41458fb6e4a (patch) | |
tree | cb0eec51f7b956a8f3d46d37986504b1ca059c95 /gdb/regcache.h | |
parent | f3384e664de76c4bb9f8fd9920afcec86557f1f0 (diff) | |
download | gdb-215c69dc9a7d8f868198b5523abcf41458fb6e4a.zip gdb-215c69dc9a7d8f868198b5523abcf41458fb6e4a.tar.gz gdb-215c69dc9a7d8f868198b5523abcf41458fb6e4a.tar.bz2 |
No longer create readonly regcache
Nowadays, we create a readonly regcache in get_return_value, and pass it
to gdbarch_return_value to get the return value. In theory, we can pass a
readable_regcache instance and get the return value, because we don't need
to modify the regcache. Unfortunately, gdbarch_return_value is designed
to multiplex regcache, according to READBUF and WRITEBUF.
# If READBUF is not NULL, extract the return value and save it in this
# buffer.
#
# If WRITEBUF is not NULL, it contains a return value which will be
# stored into the appropriate register.
In fact, gdbarch_return_value should be split to three functions, 1) only
return return_value_convention, 2) pass regcache_readonly and readbuf, 3)
pass regcache and writebuf. These changes are out of the scope of this
patch series, so I pass regcache to gdbarch_return_value even for read,
and trust each gdbarch backend doesn't modify regcache.
gdb:
2018-02-21 Yao Qi <yao.qi@linaro.org>
* infcmd.c (get_return_value): Let stop_regs point to
get_current_regcache.
* regcache.c (regcache::regcache): Remove.
(register_dump_reg_buffer): New class.
(regcache_print): Adjust.
* regcache.h (regcache): Remove constructors.
Diffstat (limited to 'gdb/regcache.h')
-rw-r--r-- | gdb/regcache.h | 10 |
1 files changed, 0 insertions, 10 deletions
diff --git a/gdb/regcache.h b/gdb/regcache.h index a377d2d..6531aff 100644 --- a/gdb/regcache.h +++ b/gdb/regcache.h @@ -307,16 +307,6 @@ class readonly_detached_regcache; class regcache : public detached_regcache { public: - regcache (gdbarch *gdbarch) - : regcache (gdbarch, nullptr, true) - {} - - struct readonly_t {}; - static constexpr readonly_t readonly {}; - - /* Create a readonly regcache from a non-readonly regcache. */ - regcache (readonly_t, const regcache &src); - DISABLE_COPY_AND_ASSIGN (regcache); /* Return REGCACHE's address space. */ |