Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Yao Qi <qiyaoltc@gmail.com>
To: gdb-patches@sourceware.org
Cc: eliz@gnu.org
Subject: [PATCH 04/22] Let i386_target_description return tdesc_i386_mmx
Date: Mon, 21 Aug 2017 15:29:00 -0000	[thread overview]
Message-ID: <1503329347-26711-5-git-send-email-yao.qi@linaro.org> (raw)
In-Reply-To: <1503329347-26711-1-git-send-email-yao.qi@linaro.org>

This patch remove the usage of tdesc_i386_mmx in i386-go32-tdep.c, and use
i386_target_description to get it instead.

gdb:

2017-08-21  Yao Qi  <yao.qi@linaro.org>

	* i386-go32-tdep.c: Include x86-xstate.h.
	(i386_go32_init_abi): Call i386_target_description.
	* i386-tdep.c (i386_target_description): Return tdesc_i386_mmx
	if xcr0 is X86_XSTATE_X87_MASK.
	* i386-tdep.h (tdesc_i386): Remove the declaration.
	(tdesc_i386_mmx): Likewise.
---
 gdb/i386-go32-tdep.c | 3 ++-
 gdb/i386-tdep.c      | 4 ++++
 gdb/i386-tdep.h      | 3 ---
 3 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/gdb/i386-go32-tdep.c b/gdb/i386-go32-tdep.c
index 5bd4857..6778e52 100644
--- a/gdb/i386-go32-tdep.c
+++ b/gdb/i386-go32-tdep.c
@@ -19,6 +19,7 @@
 
 #include "defs.h"
 #include "i386-tdep.h"
+#include "x86-xstate.h"
 #include "target-descriptions.h"
 #include "osabi.h"
 
@@ -34,7 +35,7 @@ i386_go32_init_abi (struct gdbarch_info info, struct gdbarch *gdbarch)
 
   /* DJGPP does not support the SSE registers.  */
   if (!tdesc_has_registers (info.target_desc))
-    tdep->tdesc = tdesc_i386_mmx;
+    tdep->tdesc = i386_target_description (X86_XSTATE_X87_MASK);
 
   /* Native compiler is GCC, which uses the SVR4 register numbering
      even in COFF and STABS.  See the comment in i386_gdbarch_init,
diff --git a/gdb/i386-tdep.c b/gdb/i386-tdep.c
index 9d0dd3d..d162e92 100644
--- a/gdb/i386-tdep.c
+++ b/gdb/i386-tdep.c
@@ -8730,6 +8730,10 @@ i386_target_description (uint64_t xcr0)
       return tdesc_i386_mpx;
     case X86_XSTATE_AVX_MASK:
       return tdesc_i386_avx;
+    case X86_XSTATE_SSE_MASK:
+      return tdesc_i386;
+    case X86_XSTATE_X87_MASK:
+      return tdesc_i386_mmx;
     default:
       return tdesc_i386;
     }
diff --git a/gdb/i386-tdep.h b/gdb/i386-tdep.h
index 1ce89fc..99b89e7 100644
--- a/gdb/i386-tdep.h
+++ b/gdb/i386-tdep.h
@@ -339,9 +339,6 @@ enum record_i386_regnum
 /* Size of the largest register.  */
 #define I386_MAX_REGISTER_SIZE	64
 
-extern struct target_desc *tdesc_i386;
-extern struct target_desc *tdesc_i386_mmx;
-
 /* Types for i386-specific registers.  */
 extern struct type *i387_ext_type (struct gdbarch *gdbarch);
 
-- 
1.9.1


  parent reply	other threads:[~2017-08-21 15:29 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-08-21 15:29 [PATCH 00/22 v4] Make GDB builtin target descriptions more flexible Yao Qi
2017-08-21 15:29 ` [PATCH 08/22] [GDBserver] Centralize tdesc for i386-linux Yao Qi
2017-08-21 15:29 ` [PATCH 19/22] [GDBserver] Use pre-generated amd64-linux tdesc as test Yao Qi
2017-08-21 15:29 ` [PATCH 09/22] [GDBserver] unit test to i386_tdesc Yao Qi
2017-08-21 15:29 ` [PATCH 11/22] Share i386-linux target description between GDB and GDBserver Yao Qi
2017-08-21 15:29 ` [PATCH 05/22] Adjust code generated by regformats/regdat.sh Yao Qi
2017-08-21 15:29 ` [PATCH 16/22] Centralize amd64-linux target descriptions Yao Qi
2017-08-21 15:29 ` [PATCH 15/22] Update comments in amd64_linux_core_read_description Yao Qi
2017-08-21 15:29 ` [PATCH 20/22] [GDBserver] Shorten srv_amd64_linux_xmlfiles Yao Qi
2017-08-21 15:29 ` [PATCH 03/22] Return X86_XSTATE_SSE_MASK instead of 0 in i386fbsd_core_read_xcr0 Yao Qi
2017-08-21 16:23   ` John Baldwin
2017-08-21 16:46     ` Yao Qi
2017-08-21 17:00       ` John Baldwin
2017-08-21 15:29 ` Yao Qi [this message]
2017-08-21 15:29 ` [PATCH 01/22] Use amd64_target_description to get tdesc_amd64 Yao Qi
2017-08-21 15:30 ` [PATCH 18/22] Convert amd64-linux target descriptions Yao Qi
2017-08-21 15:31 ` [PATCH 07/22] Return X86_TDESC_MMX in x86_get_ipa_tdesc_idx Yao Qi
2017-08-21 15:31 ` [PATCH 02/22] Use i386_target_description to get tdesc_i386 Yao Qi
2017-08-21 16:23   ` John Baldwin
2017-08-21 15:31 ` [PATCH 06/22] Use VEC for target_desc.reg_defs Yao Qi
2017-08-21 15:31 ` [PATCH 22/22] Convert the rest x86 target descriptions Yao Qi
2017-08-21 15:31 ` [PATCH 12/22] Remove features/i386/i386-*linux.c Yao Qi
2017-08-21 15:31 ` [PATCH 17/22] Lazily and dynamically create amd64-linux target descriptions Yao Qi
2017-08-21 15:31 ` [PATCH 21/22] Remove features/i386/amd64-*linux.c and features/i386/x32-*linux.c Yao Qi
2017-08-21 15:31 ` [PATCH 13/22] [GDBserver] Use pre-generated tdesc as test Yao Qi
2017-08-21 15:31 ` [PATCH 14/22] [GDBserver] Shorten srv_i386_linux_xmlfiles Yao Qi
2017-08-21 15:31 ` [PATCH 10/22] Dynamically composite xml in reply to GDB Yao Qi
2017-09-05  9:04 ` [PATCH 00/22 v4] Make GDB builtin target descriptions more flexible Yao Qi

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1503329347-26711-5-git-send-email-yao.qi@linaro.org \
    --to=qiyaoltc@gmail.com \
    --cc=eliz@gnu.org \
    --cc=gdb-patches@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox