From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 18266 invoked by alias); 21 Aug 2017 16:23:47 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 18241 invoked by uid 89); 21 Aug 2017 16:23:46 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-24.2 required=5.0 tests=AWL,BAYES_00,GIT_PATCH_0,GIT_PATCH_1,GIT_PATCH_2,GIT_PATCH_3,SPF_HELO_PASS,SPF_SOFTFAIL autolearn=ham version=3.3.2 spammy=HX-Greylist:succeeded, H*F:D*freebsd.org, baldwin, HX-Greylist:SMTP X-HELO: mail.baldwin.cx Received: from bigwig.baldwin.cx (HELO mail.baldwin.cx) (96.47.65.170) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 21 Aug 2017 16:23:44 +0000 Received: from ralph.baldwin.cx (c-73-231-226-104.hsd1.ca.comcast.net [73.231.226.104]) by mail.baldwin.cx (Postfix) with ESMTPSA id 2724810AF18; Mon, 21 Aug 2017 12:23:43 -0400 (EDT) From: John Baldwin To: Yao Qi Cc: gdb-patches@sourceware.org Subject: Re: [PATCH 02/22] Use i386_target_description to get tdesc_i386 Date: Mon, 21 Aug 2017 16:23:00 -0000 Message-ID: <2048546.8KZoS6B3Fh@ralph.baldwin.cx> User-Agent: KMail/4.14.10 (FreeBSD/11.1-STABLE; KDE/4.14.30; amd64; ; ) In-Reply-To: <1503329347-26711-3-git-send-email-yao.qi@linaro.org> References: <1503329347-26711-1-git-send-email-yao.qi@linaro.org> <1503329347-26711-3-git-send-email-yao.qi@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-IsSubscribed: yes X-SW-Source: 2017-08/txt/msg00404.txt.bz2 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 > > * 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