]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commit
gdbserver: refactor the definition and uses of supply_regblock
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:35 +0000 (11:17 +0100)
commit84da4a1ea0ae58ef13ce81586f031ca53eb40112
tree14c2022d4de744d8e5af2e1d5d04b5a66b2d7785
parentfe1b4d6dd9e68c80e04776d78b54d3316fdf8883
gdbserver: refactor the definition and uses of supply_regblock

The supply_regblock function takes a pointer to a buffer as an
argument and implements two different behavior based on the pointer
being null.  There are two cases where we pass nullptr, all in
tracepoint.cc, where we are essentially doing a reset on the regcache.

In fast_tracepoint_ctx::regcache, register_status array does not
even exist.  Hence, that use simply boils down to zeroing of register
data.  Do this at the time of creating the buffer and remove the call
to supply_regblock.

In fetch_traceframe_registers, inline the use with a call to `reset`.

Hence, there are no more cases left, where a nullptr would be passed
to supply_regblock.  Assert that the buffer argument is non-null and
simplify the implementation.

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