From patchwork Mon Aug 21 15:28:49 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yao Qi X-Patchwork-Id: 22266 Received: (qmail 126855 invoked by alias); 21 Aug 2017 15:29:24 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Delivered-To: mailing list gdb-patches@sourceware.org Received: (qmail 126653 invoked by uid 89); 21 Aug 2017 15:29:22 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-26.4 required=5.0 tests=BAYES_00, FREEMAIL_FROM, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE, RCVD_IN_SORBS_SPAM, SPF_PASS autolearn=ham version=3.3.2 spammy=H*Ad:U*eliz X-HELO: mail-io0-f196.google.com Received: from mail-io0-f196.google.com (HELO mail-io0-f196.google.com) (209.85.223.196) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 21 Aug 2017 15:29:21 +0000 Received: by mail-io0-f196.google.com with SMTP id p141so3443513iop.1 for ; Mon, 21 Aug 2017 08:29:20 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=GS0Ln/xRPgE/Ii0SgtfU+I/hzGZ0K0DyFbyy39hLcjQ=; b=Z/tmu79b52/hjbY/wXl6sPZBRtxzRJIKgkCt5JSczxsE5z/KyCT8UGULmxoHP28dA6 Pv5rlt5hxwhMdU76u0YJREA7XZOCF/HCapCVmD8+vqvYhHPW85+1XWXg8l0aaCHz/f9l NRwDVtC+/VK4ScLuf5mWxg2RqpaYVPGeAxbdp9mW3sCNjrnDTK5EAfH/+lZsNm6ySKVB +WawhvEe+0+OjlFeaJyJaqewvqOO9BlQ5aZ0ThYI2jr3m+Kggy1Aa+9A5YTxreX97XM9 E1YsTOYMamx0pXfzYxATdf1eMro4LeDO5t61vLlTU+meIn3yVySK4pyob96kRPmZYItX pD7Q== X-Gm-Message-State: AHYfb5hn0eUU+dt0o7Uias1p/offiGuHpDo5VzO+H5c225fHxJ1WCF7t G3jJvngCDwXVqY7B X-Received: by 10.107.167.203 with SMTP id q194mr18537529ioe.102.1503329359189; Mon, 21 Aug 2017 08:29:19 -0700 (PDT) Received: from E107787-LIN.cambridge.arm.com (static.42.136.251.148.clients.your-server.de. [148.251.136.42]) by smtp.gmail.com with ESMTPSA id p62sm5831589ioe.34.2017.08.21.08.29.18 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 21 Aug 2017 08:29:18 -0700 (PDT) From: Yao Qi X-Google-Original-From: Yao Qi 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 16:28:49 +0100 Message-Id: <1503329347-26711-5-git-send-email-yao.qi@linaro.org> In-Reply-To: <1503329347-26711-1-git-send-email-yao.qi@linaro.org> References: <1503329347-26711-1-git-send-email-yao.qi@linaro.org> X-IsSubscribed: yes 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 * 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);