Re: [PATCH v6 08/15] gdb: Update x86 Linux architectures to support XSAVE layouts.

Simon Marchi via Gdb-patches
2023-07-27T21:48:52Z

> Ooo, that's a good catch. This function is shared with amd64, so I think
> it's best if it keeps returning an xcr0 value, but we could patch
> i386_linux_core_read_description to instead do this:
>
> static const struct target_desc *
> i386_linux_core_read_description (struct gdbarch *gdbarch,
> struct target_ops *target,
> bfd *abfd)
> {
> /* Linux/i386. */
> x86_xsave_layout layout;
> uint64_t xcr0 = i386_linux_core_read_xsave_info (abfd, layout);
> if (xcr0 == X86_XSTATE_X87_MASK
> && bfd_get_section_by_name (abfd, ".reg-xfp") != NULL)
> xcr0 = X86_XSTATE_SSE_MASK;
>
> return i386_linux_read_description (xcr0);
> }

And i386_linux_core_read_xsave_info would return X86_XSTATE_X87_MASK if
it does not find a .reg-xstate section?

Simon