forked from Imagelibrary/binutils-gdb
GDB, gdbserver: Convert regcache_register_size function to method
The regcache_register_size function has one implementation in GDB, and one in gdbserver. Both of them have a gdb::checked_static_cast to their corresponding regcache class. This can be avoided by defining a pure virtual register_size method in the reg_buffer_common class, which is then implemented by the reg_buffer class in GDB, and by the regcache class in gdbserver. Calls to the register_size () function from methods of classes in the reg_buffer_common hierarchy need to be changed to calls to the newly defined method, otherwise the compiler complains that a matching method cannot be found. Co-Authored-By: Simon Marchi <simon.marchi@efficios.com> Approved-By: Simon Marchi <simon.marchi@efficios.com> Reviewed-By: Tankut Baris Aktemur <tankut.baris.aktemur@intel.com> Change-Id: I7f4f74a51e96c42604374e87321ca0e569bc07a3
This commit is contained in:
committed by
Simon Marchi
parent
1da3605797
commit
d70701731d
@@ -211,7 +211,7 @@ amd64_windows_store_arg_in_reg (struct regcache *regcache,
|
||||
|
||||
gdb_assert (valbuf.size () <= 8);
|
||||
std::copy (valbuf.begin (), valbuf.end (), buf.begin ());
|
||||
size_t reg_size = regcache_register_size (regcache, regno);
|
||||
size_t reg_size = regcache->register_size (regno);
|
||||
gdb_assert (reg_size <= buf.size ());
|
||||
gdb::array_view<gdb_byte> view (buf);
|
||||
regcache->cooked_write (regno, view.slice (0, reg_size));
|
||||
|
||||
Reference in New Issue
Block a user