From patchwork Fri Aug 22 06:54:53 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Catalin Udma X-Patchwork-Id: 2513 Received: (qmail 14488 invoked by alias); 22 Aug 2014 06:59:07 -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 14476 invoked by uid 89); 22 Aug 2014 06:59:06 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.3 required=5.0 tests=AWL, BAYES_00, RCVD_IN_DNSWL_NONE, SPF_HELO_PASS, SPF_PASS autolearn=ham version=3.3.2 X-HELO: na01-bn1-obe.outbound.protection.outlook.com Received: from mail-bn1blp0181.outbound.protection.outlook.com (HELO na01-bn1-obe.outbound.protection.outlook.com) (207.46.163.181) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-SHA encrypted) ESMTPS; Fri, 22 Aug 2014 06:59:04 +0000 Received: from BY2PR03CA072.namprd03.prod.outlook.com (10.141.249.45) by BY2PR03MB174.namprd03.prod.outlook.com (10.242.36.142) with Microsoft SMTP Server (TLS) id 15.0.1005.10; Fri, 22 Aug 2014 06:59:00 +0000 Received: from BN1BFFO11FD030.protection.gbl (2a01:111:f400:7c10::1:188) by BY2PR03CA072.outlook.office365.com (2a01:111:e400:2c5d::45) with Microsoft SMTP Server (TLS) id 15.0.1010.18 via Frontend Transport; Fri, 22 Aug 2014 06:59:00 +0000 Received: from az84smr01.freescale.net (192.88.158.2) by BN1BFFO11FD030.mail.protection.outlook.com (10.58.144.93) with Microsoft SMTP Server (TLS) id 15.0.1010.11 via Frontend Transport; Fri, 22 Aug 2014 06:58:59 +0000 Received: from udp122517uds.ea.freescale.net (udp122517uds.ea.freescale.net [10.171.74.8]) by az84smr01.freescale.net (8.14.3/8.14.0) with ESMTP id s7M6wv2P006659; Thu, 21 Aug 2014 23:58:58 -0700 From: Catalin Udma To: CC: Catalin Udma Subject: [PATCH v2] aarch64/gdbserver: fix floating point registers display Date: Fri, 22 Aug 2014 09:54:53 +0300 Message-ID: <1408690493-5243-1-git-send-email-catalin.udma@freescale.com> X-EOPAttributedMessage: 0 X-Forefront-Antispam-Report: CIP:192.88.158.2; CTRY:US; IPV:CAL; IPV:NLI; EFV:NLI; SFV:NSPM; SFS:(6009001)(377424004)(199003)(189002)(81156004)(50226001)(81542001)(83322001)(68736004)(48376002)(99396002)(62966002)(102836001)(106466001)(107046002)(69596002)(44976005)(2351001)(79102001)(229853001)(95666004)(77156001)(104166001)(105606002)(77982001)(80022001)(19580405001)(19580395003)(81342001)(97736001)(83072002)(26826002)(64706001)(93916002)(86362001)(74662001)(46102001)(88136002)(104016003)(50986999)(50466002)(84676001)(47776003)(92726001)(89996001)(21056001)(85306004)(31966008)(110136001)(76482001)(4396001)(33646002)(74502001)(20776003)(36756003)(85852003)(92566001)(6806004)(87936001)(90102001)(87286001); DIR:OUT; SFP:; SCL:1; SRVR:BY2PR03MB174; H:az84smr01.freescale.net; FPR:; MLV:ovrnspm; PTR:InfoDomainNonexistent; A:1; MX:1; LANG:en; MIME-Version: 1.0 X-Microsoft-Antispam: BCL:0;PCL:0;RULEID:;UriScan:; X-Forefront-PRVS: 0311124FA9 Received-SPF: Fail (protection.outlook.com: domain of freescale.com does not designate 192.88.158.2 as permitted sender) receiver=protection.outlook.com; client-ip=192.88.158.2; helo=az84smr01.freescale.net; Authentication-Results: spf=fail (sender IP is 192.88.158.2) smtp.mailfrom=catalin.udma@freescale.com; X-OriginatorOrg: freescale.com When using aarch64 gdb with gdbserver, floating point registers are not correctly displayed, as below: (gdb) info registers fpsr fpcr fpsr fpcr To fix these problems, the missing fpsr and fpcr registers are added when floating point registers are read/write gdb/gdbserver/ 2014-08-12 Catalin Udma * linux-aarch64-low.c (AARCH64_FPSR_REGNO): New define. (AARCH64_FPCR_REGNO): Likewise. (AARCH64_NUM_REGS): Update to include fpsr/fpcr registers. (aarch64_fill_fpregset): Add missing fpsr/fpcr registers. (aarch64_store_fpregset): Likewise. --- gdb/gdbserver/linux-aarch64-low.c | 8 +++++++- 1 files changed, 7 insertions(+), 1 deletions(-) diff --git a/gdb/gdbserver/linux-aarch64-low.c b/gdb/gdbserver/linux-aarch64-low.c index 6066e15..3453b2e 100644 --- a/gdb/gdbserver/linux-aarch64-low.c +++ b/gdb/gdbserver/linux-aarch64-low.c @@ -46,8 +46,10 @@ extern const struct target_desc *tdesc_aarch64; #define AARCH64_PC_REGNO 32 #define AARCH64_CPSR_REGNO 33 #define AARCH64_V0_REGNO 34 +#define AARCH64_FPSR_REGNO (AARCH64_V0_REGNO + AARCH64_V_REGS_NUM) +#define AARCH64_FPCR_REGNO (AARCH64_V0_REGNO + AARCH64_V_REGS_NUM + 1) -#define AARCH64_NUM_REGS (AARCH64_V0_REGNO + AARCH64_V_REGS_NUM) +#define AARCH64_NUM_REGS (AARCH64_V0_REGNO + AARCH64_V_REGS_NUM + 2) static int aarch64_regmap [] = @@ -255,6 +257,8 @@ aarch64_fill_fpregset (struct regcache *regcache, void *buf) for (i = 0; i < AARCH64_V_REGS_NUM; i++) collect_register (regcache, AARCH64_V0_REGNO + i, ®set->vregs[i]); + collect_register (regcache, AARCH64_FPSR_REGNO, ®set->fpsr); + collect_register (regcache, AARCH64_FPCR_REGNO, ®set->fpcr); } static void @@ -265,6 +269,8 @@ aarch64_store_fpregset (struct regcache *regcache, const void *buf) for (i = 0; i < AARCH64_V_REGS_NUM; i++) supply_register (regcache, AARCH64_V0_REGNO + i, ®set->vregs[i]); + supply_register (regcache, AARCH64_FPSR_REGNO, ®set->fpsr); + supply_register (regcache, AARCH64_FPCR_REGNO, ®set->fpcr); } /* Debugging of hardware breakpoint/watchpoint support. */