]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commit
gdbserver: define and use regcache::reset
authorTankut Baris Aktemur <tankut.baris.aktemur@intel.com>
Wed, 29 Jan 2025 09:50:31 +0000 (10:50 +0100)
committerTankut Baris Aktemur <tankut.baris.aktemur@intel.com>
Wed, 29 Jan 2025 10:17:34 +0000 (11:17 +0100)
commitfe1b4d6dd9e68c80e04776d78b54d3316fdf8883
tree94aa8759b93c7b797400664d1cef1cd6039fc1ed
parentb5a42cbfd9643c3c418efc553dd84a9293e0336e
gdbserver: define and use regcache::reset

Define a `reset` method for a regcache and use it for code
simplification.  This patch allows further simplification in the next
patch.

The reset method fills the register data with zeroes.  For the use in
get_thread_regcache, this is added behavior, making the patch not a
pure refactoring, and may look like extra overhead.  However, it is
better to avoid having arbitrary values left in the data buffer.
Hence, it is considered a behavioral improvement.

Approved-By: Simon Marchi <simon.marchi@efficios.com>
gdbserver/regcache.cc
gdbserver/regcache.h