From patchwork Tue Dec 20 06:35:39 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ivo Raisr X-Patchwork-Id: 88544 Delivered-To: patch@linaro.org Received: by 10.140.20.101 with SMTP id 92csp1570363qgi; Mon, 19 Dec 2016 22:36:09 -0800 (PST) X-Received: by 10.84.209.134 with SMTP id y6mr22855591plh.32.1482215769238; Mon, 19 Dec 2016 22:36:09 -0800 (PST) Return-Path: Received: from sourceware.org (server1.sourceware.org. [209.132.180.131]) by mx.google.com with ESMTPS id u89si20910484pfg.283.2016.12.19.22.36.08 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 19 Dec 2016 22:36:09 -0800 (PST) Received-SPF: pass (google.com: domain of gdb-patches-return-135844-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) client-ip=209.132.180.131; Authentication-Results: mx.google.com; dkim=pass header.i=@sourceware.org; spf=pass (google.com: domain of gdb-patches-return-135844-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) smtp.mailfrom=gdb-patches-return-135844-patch=linaro.org@sourceware.org DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:subject:to:references:cc:from:message-id:date :mime-version:in-reply-to:content-type; q=dns; s=default; b=G3G0 uI/UFtGFUNI+CB/tK5/oIlsM2bQh7ilYh9+N+HRRZlfNeYtkp/Mz9N9Ohg75eFMm 8eYdhcodCnFKsAAixnnRAaKmJHKOeolxXEgYeYigwCMHa8GUSRiXD7verekJgz7p hJHlZdJdDfbhxmtW/jQOf39IorUOXi+2TfGbTmI= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:subject:to:references:cc:from:message-id:date :mime-version:in-reply-to:content-type; s=default; bh=7iJitjZcjK FndSaPnblqAINBXx8=; b=BRmAUvuqx1kl1IV9ZQLr9SFbObt9+x7DprcMvf2Gn4 V+3aKktu6K012rrkxaALPcZLxZ9E9uXK+w1VBzrL/JFwSTLCT6k1BCV9QxVLZj4o epVIILB5w6tSl+oICuqV2lznq/czrjfjQdNTVMALOcOwSS50pRJPBhBRQ/gAofu7 k= Received: (qmail 47547 invoked by alias); 20 Dec 2016 06:35:58 -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 47525 invoked by uid 89); 20 Dec 2016 06:35:57 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.2 required=5.0 tests=BAYES_00, RP_MATCHES_RCVD, SPF_PASS, UNWANTED_LANGUAGE_BODY autolearn=ham version=3.3.2 spammy=3277, 327, 7, gdbarch, *gdbarch X-HELO: aserp1040.oracle.com Received: from aserp1040.oracle.com (HELO aserp1040.oracle.com) (141.146.126.69) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 20 Dec 2016 06:35:47 +0000 Received: from aserv0022.oracle.com (aserv0022.oracle.com [141.146.126.234]) by aserp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id uBK6Zhcn020762 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 20 Dec 2016 06:35:43 GMT Received: from aserv0122.oracle.com (aserv0122.oracle.com [141.146.126.236]) by aserv0022.oracle.com (8.14.4/8.14.4) with ESMTP id uBK6ZgCc014512 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 20 Dec 2016 06:35:43 GMT Received: from abhmp0010.oracle.com (abhmp0010.oracle.com [141.146.116.16]) by aserv0122.oracle.com (8.14.4/8.14.4) with ESMTP id uBK6ZfJj022072; Tue, 20 Dec 2016 06:35:42 GMT Received: from [10.175.225.63] (/10.175.225.63) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Mon, 19 Dec 2016 22:35:41 -0800 Subject: Re: [PATCH] Bug 20928 - Decode %ccr into individual flags in sparcv9 register output To: Luis Machado References: <27bde9c3-4f6c-e3fa-93a2-3531ea489e1d@codesourcery.com> <4c1b29e0-8040-b9c8-5c45-5a5dd6acd835@oracle.com> Cc: gdb-patches@sourceware.org From: Ivo Raisr Message-ID: <8b54e424-fa3b-78c8-8e57-d5baff850178@oracle.com> Date: Tue, 20 Dec 2016 07:35:39 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.5.1 MIME-Version: 1.0 In-Reply-To: <4c1b29e0-8040-b9c8-5c45-5a5dd6acd835@oracle.com> Any news here? Thanks, I. On 6.12.2016 09:26, Ivo Raisr wrote: > > > On 6.12.2016 03:03, Luis Machado wrote: >> On 12/05/2016 05:45 PM, Ivo Raisr wrote: >>> >>> >>> ChangeLog entry: >>> 2016-12-05 Ivo Raisr >>> >>> PR tdep/20928 >>> Decode %ccr into individual flags in sparcv9 register output. >>> * sparc-tdep.h: Declare %ccr type. >>> * sparc64-tdep.c: Decode %ccr. Fix %fsr decoding. >> >> You need to mention the new sparc64_ccr_type field and the new >> function in the ChangeLog. Also, you need to add the function where >> you fixed the fsr decoding. > > Here is the fixed ChangeLog entry (and attached new version of patch): > > 2016-12-05 Ivo Raisr > > PR tdep/20928 > Decode %ccr into individual flags in sparcv9 register output. > * sparc-tdep.h: Declare sparc64_ccr_type. > * sparc64-tdep.c: Decode %ccr in a new function sparc64_ccr_type(). > Fix %fsr decoding in sparc64_fsr_type(). > > diff -upr a/ChangeLog b/ChangeLog --- a/ChangeLog 2016-02-24 01:55:15.000000000 +0000 +++ b/ChangeLog 2016-12-05 15:38:46.962931312 +0000 @@ -1,3 +1,11 @@ +2016-12-05 Ivo Raisr + + PR tdep/20928 + Decode %ccr into individual flags in sparcv9 register output. + * sparc-tdep.h: Declare sparc64_ccr_type. + * sparc64-tdep.c: Decode %ccr in a new function sparc64_ccr_type(). + Fix %fsr decoding in sparc64_fsr_type(). + 2016-01-12 H.J. Lu Sync with GCC diff -upr a/gdb/sparc-tdep.h b/gdb/sparc-tdep.h --- a/gdb/sparc-tdep.h 2016-02-09 19:19:39.000000000 +0000 +++ b/gdb/sparc-tdep.h 2016-12-05 15:25:55.187764842 +0000 @@ -76,6 +76,7 @@ struct gdbarch_tdep /* ISA-specific data types. */ struct type *sparc_psr_type; struct type *sparc_fsr_type; + struct type *sparc64_ccr_type; struct type *sparc64_pstate_type; struct type *sparc64_fsr_type; struct type *sparc64_fprs_type; diff -upr a/gdb/sparc64-tdep.c b/gdb/sparc64-tdep.c --- a/gdb/sparc64-tdep.c 2016-02-09 19:19:39.000000000 +0000 +++ b/gdb/sparc64-tdep.c 2016-12-05 15:26:04.242830444 +0000 @@ -172,6 +172,31 @@ sparc64_pstate_type (struct gdbarch *gdb } static struct type * +sparc64_ccr_type (struct gdbarch *gdbarch) +{ + struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch); + + if (tdep->sparc64_ccr_type == NULL) + { + struct type *type; + + type = arch_flags_type (gdbarch, "builtin_type_sparc64_ccr", 8); + append_flags_type_flag (type, 0, "icc.c"); + append_flags_type_flag (type, 1, "icc.v"); + append_flags_type_flag (type, 2, "icc.z"); + append_flags_type_flag (type, 3, "icc.n"); + append_flags_type_flag (type, 4, "xcc.c"); + append_flags_type_flag (type, 5, "xcc.v"); + append_flags_type_flag (type, 6, "xcc.z"); + append_flags_type_flag (type, 7, "xcc.n"); + + tdep->sparc64_ccr_type = type; + } + + return tdep->sparc64_ccr_type; +} + +static struct type * sparc64_fsr_type (struct gdbarch *gdbarch) { struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch); @@ -181,16 +206,16 @@ sparc64_fsr_type (struct gdbarch *gdbarc struct type *type; type = arch_flags_type (gdbarch, "builtin_type_sparc64_fsr", 8); - append_flags_type_flag (type, 0, "NXA"); - append_flags_type_flag (type, 1, "DZA"); - append_flags_type_flag (type, 2, "UFA"); - append_flags_type_flag (type, 3, "OFA"); - append_flags_type_flag (type, 4, "NVA"); - append_flags_type_flag (type, 5, "NXC"); - append_flags_type_flag (type, 6, "DZC"); - append_flags_type_flag (type, 7, "UFC"); - append_flags_type_flag (type, 8, "OFC"); - append_flags_type_flag (type, 9, "NVC"); + append_flags_type_flag (type, 0, "NXC"); + append_flags_type_flag (type, 1, "DZC"); + append_flags_type_flag (type, 2, "UFC"); + append_flags_type_flag (type, 3, "OFC"); + append_flags_type_flag (type, 4, "NVC"); + append_flags_type_flag (type, 5, "NXA"); + append_flags_type_flag (type, 6, "DZA"); + append_flags_type_flag (type, 7, "UFA"); + append_flags_type_flag (type, 8, "OFA"); + append_flags_type_flag (type, 9, "NVA"); append_flags_type_flag (type, 22, "NS"); append_flags_type_flag (type, 23, "NXM"); append_flags_type_flag (type, 24, "DZM"); @@ -327,7 +352,7 @@ sparc64_register_type (struct gdbarch *g if (regnum == SPARC64_ASI_REGNUM) return builtin_type (gdbarch)->builtin_int64; if (regnum == SPARC64_CCR_REGNUM) - return builtin_type (gdbarch)->builtin_int64; + return sparc64_ccr_type (gdbarch); if (regnum >= SPARC64_D0_REGNUM && regnum <= SPARC64_D62_REGNUM) return builtin_type (gdbarch)->builtin_double; if (regnum >= SPARC64_Q0_REGNUM && regnum <= SPARC64_Q60_REGNUM)