]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commit
gdbserver: fix the declared type of register_status in regcache
authorTankut Baris Aktemur <tankut.baris.aktemur@intel.com>
Wed, 29 Jan 2025 09:50:32 +0000 (10:50 +0100)
committerTankut Baris Aktemur <tankut.baris.aktemur@intel.com>
Wed, 29 Jan 2025 10:17:35 +0000 (11:17 +0100)
commit0cefb59c18b5ceaa5e53d8576b3a653f42ab6ada
treef8612d436f1d4bb4493ac359873a877d37c25c68
parent84da4a1ea0ae58ef13ce81586f031ca53eb40112
gdbserver: fix the declared type of register_status in regcache

The register_status field of regcache is declared as `unsigned char *`.
This is incorrect, because `enum register_status` from
gdbsupport/common-regcache.h is based on signed char and
REG_UNAVAILABLE is defined as -1.  Fix the declared type.

Now that we are modifying the declaration, also use a unique_ptr
and make the field private.

The get/set methods already use the correct type, but we update cast
operations in two places.

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