This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH 02/22] Use i386_target_description to get tdesc_i386
On Monday, August 21, 2017 04:28:47 PM Yao Qi wrote:
> GDB can call function i386_target_description to get the right target
> description rather than tdesc_i386.
>
> gdb:
>
> 2017-08-18 Yao Qi <yao.qi@linaro.org>
>
> * amd64-fbsd-nat.c (amd64fbsd_read_description): Call
> i386_target_description.
> * i386-fbsd-nat.c (i386fbsd_read_description): Call
> i386_target_description.
> * i386-tdep.c (i386_gdbarch_init): Likewise.
> ---
> gdb/amd64-fbsd-nat.c | 2 +-
> gdb/i386-fbsd-nat.c | 10 ++++------
> gdb/i386-tdep.c | 2 +-
> 3 files changed, 6 insertions(+), 8 deletions(-)
>
> diff --git a/gdb/amd64-fbsd-nat.c b/gdb/amd64-fbsd-nat.c
> index f3ddbdd..a22b82b 100644
> --- a/gdb/amd64-fbsd-nat.c
> +++ b/gdb/amd64-fbsd-nat.c
> @@ -181,7 +181,7 @@ amd64fbsd_read_description (struct target_ops *ops)
> if (is64)
> return amd64_target_description (X86_XSTATE_SSE_MASK);
> else
> - return tdesc_i386;
> + return i386_target_description (X86_XSTATE_SSE_MASK);
> }
Hmm, I think we can further simplify amd64fbsd_read_description by always
using amd64/i386_target_description and just setting xcr0 to
X86_XSTATE_SSE_MASK in the #else case and if xsave_len is 0.
--
John Baldwin