From patchwork Tue Dec 6 08:26:17 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ivo Raisr X-Patchwork-Id: 86707 Delivered-To: patch@linaro.org Received: by 10.140.20.101 with SMTP id 92csp1900935qgi; Tue, 6 Dec 2016 00:26:52 -0800 (PST) X-Received: by 10.99.134.72 with SMTP id x69mr110344135pgd.140.1481012812691; Tue, 06 Dec 2016 00:26:52 -0800 (PST) Return-Path: Received: from sourceware.org (server1.sourceware.org. [209.132.180.131]) by mx.google.com with ESMTPS id l21si18584282pli.179.2016.12.06.00.26.52 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 06 Dec 2016 00:26:52 -0800 (PST) Received-SPF: pass (google.com: domain of gdb-patches-return-135646-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-135646-patch=linaro.org@sourceware.org designates 209.132.180.131 as permitted sender) smtp.mailfrom=gdb-patches-return-135646-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=wpbw bENbKOQoMddfxQ+jmDzdI8pHYJRfbCxn7CdRvZhwu1MiL1hqDXCtIZDSwO48pb3L avIXUqbYFREKigA1PpG6mZxyqKtptop0C+LbTur3H2CV0XRBM4iEEOaCgtRZPpBI INKy9t4VEQ2FMks1UfY+NIGfH+J5yo1HFMXWH4g= 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=cMLKuDkR2n LV7p4aURd6ukXXv4M=; b=TVWmXKMocVn+ZPdPVWTv0Vn0DFzeKNBTwbB6wLz6mp DKfJihdQnZHk3kY34uR0tvsQpnFGepvody1OSHTlMYsvLsmCXz5ggdlNq3OXw2ND pfP+CyilnMSQmtrQ5KXobUwIegh0R4PADGOCoSwwnMRO3+CvnYBW0HXJRrmBAmh8 o= Received: (qmail 62850 invoked by alias); 6 Dec 2016 08:26:35 -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 62819 invoked by uid 89); 6 Dec 2016 08:26:34 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.0 required=5.0 tests=BAYES_00, RP_MATCHES_RCVD, SPF_PASS, UNWANTED_LANGUAGE_BODY autolearn=ham version=3.3.2 spammy=H*MI:sk:27bde9c, H*f:sk:27bde9c, H*i:sk:27bde9c X-HELO: userp1040.oracle.com Received: from userp1040.oracle.com (HELO userp1040.oracle.com) (156.151.31.81) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 06 Dec 2016 08:26:24 +0000 Received: from aserv0022.oracle.com (aserv0022.oracle.com [141.146.126.234]) by userp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id uB68QKkg021365 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 6 Dec 2016 08:26:21 GMT Received: from userv0121.oracle.com (userv0121.oracle.com [156.151.31.72]) by aserv0022.oracle.com (8.14.4/8.14.4) with ESMTP id uB68QKJt000844 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 6 Dec 2016 08:26:20 GMT Received: from abhmp0015.oracle.com (abhmp0015.oracle.com [141.146.116.21]) by userv0121.oracle.com (8.14.4/8.13.8) with ESMTP id uB68QJOM003777; Tue, 6 Dec 2016 08:26:19 GMT Received: from [10.175.244.192] (/10.175.244.192) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Tue, 06 Dec 2016 00:26:19 -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> Cc: gdb-patches@sourceware.org From: Ivo Raisr Message-ID: <4c1b29e0-8040-b9c8-5c45-5a5dd6acd835@oracle.com> Date: Tue, 6 Dec 2016 08:26:17 +0000 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: <27bde9c3-4f6c-e3fa-93a2-3531ea489e1d@codesourcery.com> 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)