From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 12354 invoked by alias); 5 Dec 2014 12:38:28 -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 12343 invoked by uid 89); 5 Dec 2014 12:38:28 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-0.4 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_NONE,SPF_HELO_PASS,SPF_PASS,UNSUBSCRIBE_BODY autolearn=no version=3.3.2 X-HELO: na01-bl2-obe.outbound.protection.outlook.com Received: from mail-bl2on0132.outbound.protection.outlook.com (HELO na01-bl2-obe.outbound.protection.outlook.com) (65.55.169.132) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-SHA encrypted) ESMTPS; Fri, 05 Dec 2014 12:38:25 +0000 Received: from BY2PR03MB175.namprd03.prod.outlook.com (10.242.36.148) by BY2PR03MB174.namprd03.prod.outlook.com (10.242.36.142) with Microsoft SMTP Server (TLS) id 15.1.26.15; Fri, 5 Dec 2014 12:38:21 +0000 Received: from BY2PR03MB175.namprd03.prod.outlook.com ([169.254.5.250]) by BY2PR03MB175.namprd03.prod.outlook.com ([169.254.5.250]) with mapi id 15.01.0026.003; Fri, 5 Dec 2014 12:38:21 +0000 From: "catalin.udma@freescale.com" To: Pedro Alves , "gdb-patches@sourceware.org" Subject: RE: [PATCH v3] aarch64/gdbserver: fix floating point registers display Date: Fri, 05 Dec 2014 12:38:00 -0000 Message-ID: References: <1412846214-21419-1-git-send-email-catalin.udma@freescale.com> <54379ADD.2040400@redhat.com> In-Reply-To: <54379ADD.2040400@redhat.com> x-microsoft-antispam: BCL:0;PCL:0;RULEID:;SRVR:BY2PR03MB174; x-exchange-antispam-report-test: UriScan:; x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:;SRVR:BY2PR03MB174; x-forefront-prvs: 04163EF38A x-forefront-antispam-report: SFV:NSPM;SFS:(10019020)(6009001)(13464003)(377454003)(479174003)(57704003)(24454002)(45984002)(189002)(199003)(164054003)(377424004)(51704005)(68736005)(54206007)(54356999)(106356001)(74316001)(50986999)(54606007)(62966003)(33656002)(66066001)(76176999)(101416001)(107886001)(15975445007)(102836002)(31966008)(77156002)(107046002)(106116001)(99286002)(105586002)(122556002)(40100003)(76576001)(46102003)(97736003)(4396001)(92566001)(20776003)(21056001)(87936001)(86362001)(64706001)(19580395003)(19580405001)(2656002)(120916001)(99396003);DIR:OUT;SFP:1102;SCL:1;SRVR:BY2PR03MB174;H:BY2PR03MB175.namprd03.prod.outlook.com;FPR:;SPF:None;MLV:sfv;PTR:InfoNoRecords;MX:1;A:1;LANG:en; Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: freescale.com X-SW-Source: 2014-12/txt/msg00133.txt.bz2 Hi Pedro, Also, this patch is not pushed yet. I'm not sure, do I need to get read-write permission to git and directly pu= sh the patch ? Thanks, Catalin -----Original Message----- From: Pedro Alves [mailto:palves@redhat.com]=20 Sent: Friday, October 10, 2014 11:38 AM To: Udma Catalin-Dan-B32721; gdb-patches@sourceware.org Subject: Re: [PATCH v3] aarch64/gdbserver: fix floating point registers dis= play Hi Catalin, Thank you very much for pushing through with the new test. This is OK. Please push. Thanks, Pedro Alves On 10/09/2014 10:16 AM, Catalin Udma wrote: > When using aarch64 gdb with gdbserver, floating point registers are > not correctly displayed, as below: > (gdb) info registers fpsr fpcr > fpsr > fpcr >=20 > To fix these problems, the missing fpsr and fpcr registers are added > when floating point registers are read/write > Add test for aarch64 floating point > PR server/17457 >=20 > gdb/gdbserver/ > 2014-10-09 Catalin Udma >=20 > PR server/17457 > * 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. >=20 > gdb/testsuite/ > 2014-10-09 Catalin Udma >=20 > PR server/17457 > * gdb.arch/aarch64-fp.c: New file. > * gdb.arch/aarch64-fp.exp: New file. >=20 > Signed-off-by: Catalin Udma > --- > gdb/gdbserver/linux-aarch64-low.c | 8 +++- > gdb/testsuite/gdb.arch/aarch64-fp.c | 38 +++++++++++++++ > gdb/testsuite/gdb.arch/aarch64-fp.exp | 85 +++++++++++++++++++++++++++= ++++++ > 3 files changed, 130 insertions(+), 1 deletions(-) > create mode 100644 gdb/testsuite/gdb.arch/aarch64-fp.c > create mode 100644 gdb/testsuite/gdb.arch/aarch64-fp.exp >=20 > diff --git a/gdb/gdbserver/linux-aarch64-low.c b/gdb/gdbserver/linux-aarc= h64-low.c > index 654b319..4fe023f 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) >=20=20 > -#define AARCH64_NUM_REGS (AARCH64_V0_REGNO + AARCH64_V_REGS_NUM) > +#define AARCH64_NUM_REGS (AARCH64_V0_REGNO + AARCH64_V_REGS_NUM + 2) >=20=20 > static int > aarch64_regmap [] =3D > @@ -255,6 +257,8 @@ aarch64_fill_fpregset (struct regcache *regcache, voi= d *buf) >=20=20 > for (i =3D 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); > } >=20=20 > static void > @@ -265,6 +269,8 @@ aarch64_store_fpregset (struct regcache *regcache, co= nst void *buf) >=20=20 > for (i =3D 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); > } >=20=20 > /* Enable miscellaneous debugging output. The name is historical - it > diff --git a/gdb/testsuite/gdb.arch/aarch64-fp.c b/gdb/testsuite/gdb.arch= /aarch64-fp.c > new file mode 100644 > index 0000000..c52647d > --- /dev/null > +++ b/gdb/testsuite/gdb.arch/aarch64-fp.c > @@ -0,0 +1,38 @@ > +/* This file is part of GDB, the GNU debugger. > + > + Copyright 2008-2014 Free Software Foundation, Inc. > + > + This program is free software; you can redistribute it and/or modify > + it under the terms of the GNU General Public License as published by > + the Free Software Foundation; either version 3 of the License, or > + (at your option) any later version. > + > + This program is distributed in the hope that it will be useful, > + but WITHOUT ANY WARRANTY; without even the implied warranty of > + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the > + GNU General Public License for more details. > + > + You should have received a copy of the GNU General Public License > + along with this program. If not, see .= */ > + > +int > +main (void) > +{ > + char buf0[] =3D {0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17, > + 0x18, 0x19, 0x1a, 0x1b, 0x1c, 0x1d, 0x1e, 0x1f}; > + char buf1[] =3D {0x20, 0x21, 0x22, 0x23, 0x24, 0x25, 0x26, 0x27, > + 0x28, 0x29, 0x2a, 0x2b, 0x2c, 0x2d, 0x2e, 0x2f}; > + long val; > + void *addr; > +=20=20=20=20 > + addr =3D &buf0[0]; > + __asm __volatile ("ldr %x0, [%1]" : "=3Dr" (val) : "r" (&addr)); > + __asm __volatile ("ldr q0, [x0]"); > +=20=20=20 > + addr =3D &buf1[0]; > + __asm __volatile ("ldr %x0, [%1]" : "=3Dr" (val) : "r" (&addr)); > + __asm __volatile ("ldr q1, [x0]"); > +=20=20 > + return 1; > +} > + > diff --git a/gdb/testsuite/gdb.arch/aarch64-fp.exp b/gdb/testsuite/gdb.ar= ch/aarch64-fp.exp > new file mode 100644 > index 0000000..c9785a9 > --- /dev/null > +++ b/gdb/testsuite/gdb.arch/aarch64-fp.exp > @@ -0,0 +1,85 @@ > +# Copyright 2008-2014 Free Software Foundation, Inc. > +# > +# This program is free software; you can redistribute it and/or modify > +# it under the terms of the GNU General Public License as published by > +# the Free Software Foundation; either version 3 of the License, or > +# (at your option) any later version. > +# > +# This program is distributed in the hope that it will be useful, > +# but WITHOUT ANY WARRANTY; without even the implied warranty of > +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the > +# GNU General Public License for more details. > +# > +# You should have received a copy of the GNU General Public License > +# along with this program; if not, write to the Free Software > +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, = USA. > +# > +# This file is part of the gdb testsuite. > + > +# PR server/17457 > +# Test aarch64 floating point registers q0, q1, v0, v1, fpsr, fpcr > + > +if {![istarget "aarch64*"]} { > + verbose "Skipping ${gdb_test_file_name}." > + return > +} > + > +standard_testfile > +if { [prepare_for_testing ${testfile}.exp ${testfile} ${srcfile}] } { > + return -1 > +} > + > +if ![runto_main] { > + untested "could not run to main" > + return -1 > +} > + > +set endianness "little" > +set test "show endian" > +gdb_test_multiple $test $test { > + -re "(.* )(big|little)( endian.*)$gdb_prompt $" { > + set endianness $expect_out(2,string) > + pass "endianness" > + } > +} > + > +gdb_test "break ${srcfile}:[gdb_get_line_number "return"]" \ > + "Breakpoint $decimal at 0x\[0-9a-fA-F\]+: file .*${srcfile}.*\\\." \ > + "set the breakpoint after setting the fp registers" > + > +gdb_test "continue" \ > + "Continuing.*Breakpoint $decimal.*" \ > + "continue until breakpoint" > + > +if {$endianness =3D=3D "little"} { > + set reg_value0 "0x1f1e1d1c1b1a19181716151413121110" > + set reg_value1 "0x2f2e2d2c2b2a29282726252423222120" > +} else { > + set reg_value0 "0x101112131415161718191a1b1c1d1e1f" > + set reg_value1 "0x202122232425262728292a2b2c2d2e2f" > +} > + > +gdb_test "info registers q0" \ > + "q0.*{u =3D $reg_value0, s =3D $reg_value0.*" \ > + "check register q0 value" > + > +gdb_test "info registers q1" \ > + "q1.*{u =3D $reg_value1, s =3D $reg_value1.*" \ > + "check register q1 value" > + > +gdb_test "info registers v0" \ > + "v0.*$reg_value0}}}" \ > + "check register v0 value" > + > +gdb_test "info registers v1" \ > + "v1.*$reg_value1}}}" \ > + "check register v1 value" > + > +gdb_test "info registers fpsr" \ > + "fpsr.*0x\[0-9a-fA-F\].*" \ > + "check register fpsr value" > + > +gdb_test "info registers fpcr" \ > + "fpcr.*0x\[0-9a-fA-F\].*" \ > + "check register fpcr value" > + >=20