]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commit
gdbserver: Add assert in x86_linux_read_description.
authorChristina Schimpe <christina.schimpe@intel.com>
Tue, 6 Feb 2024 18:37:27 +0000 (13:37 -0500)
committerChristina Schimpe <christina.schimpe@intel.com>
Fri, 29 Aug 2025 17:02:08 +0000 (17:02 +0000)
commit86d75cf3897faeced162c4a911a90ac330a71137
treece2e878899f5318626828945962b5461b3f2cf98
parent81d4480fe98c7191191a65189a2834f9e9e1b855
gdbserver: Add assert in x86_linux_read_description.

On x86 the PTRACE_GETREGSET request is currently only used for the xstate regset.
The size of the xstate regset is initialized to 0 such that it can be reset to
the appropriate size once we know it is supported for the current target
in x86_linux_read_description.

However, this configuration would not just affect the xstate regset but any regset
with PTRACE_GETREGSET request that is added in the future.  The new regset  would be
misconfigured with the xstate regset size.  To avoid this we add an assert for
unsupported regsets and check explicitly for the note type of the register set.

Reviewed-by: Thiago Jung Bauermann <thiago.bauermann@linaro.org>
Approved-By: Luis Machado <luis.machado@arm.com>
gdbserver/linux-x86-low.cc