commit
868883583e7520ff1bd99fcb224d2b33a990edff
Author: Andrew Burgess <aburgess@redhat.com>
Date: Sat Mar 23 16:17:36 2024 +0000
gdb/arch: assert that X86_XSTATE_MPX is not set for x32
added
if (xcr0 & X86_XSTATE_MPX)
{
/* MPX is not available on x32. */
gdb_assert (!is_x32);
regnum = create_feature_i386_64bit_mpx (tdesc.get (), regnum);
}
But x32 is a software convention. There is no x32 mode in hardware and
CPU always returns the 64-bit mode XCR0 value for x32 processes. This
regression was fixed on master branch by
commit
bf616be99153b43c1077be9dbb7b081b4c080031 (HEAD)
Author: Andrew Burgess <aburgess@redhat.com>
Date: Thu Jan 25 14:25:57 2024 +0000
gdb/gdbserver: share some code relating to target description creation
which used the gdbserver code to clear the X86_XSTATE_MPX bit in XCR0 for
x32. Fix this regression on gdb-15-branch by clearing the X86_XSTATE_MPX
bit in XCR0 for x32 in gdb.
PR gdb/32143
* x86-linux-nat.c (x86_linux_nat_target::read_description): Clear
the X86_XSTATE_MPX bit in XCR0 for x32.
Signed-off-by: H.J. Lu <hjl.tools@gmail.com>
xcr0 = xstateregs[(I386_LINUX_XSAVE_XCR0_OFFSET
/ sizeof (uint64_t))];
+#ifdef __x86_64__
+ /* No MPX on x32. */
+ if (is_x32)
+ xcr0 &= ~X86_XSTATE_MPX;
+#endif
+
m_xsave_layout = x86_fetch_xsave_layout (xcr0, x86_xsave_length ());
}
}