From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 22775 invoked by alias); 13 Feb 2014 16:34:07 -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 22763 invoked by uid 89); 13 Feb 2014 16:34:06 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.0 required=5.0 tests=AWL,BAYES_00,RP_MATCHES_RCVD,SPF_PASS,UNPARSEABLE_RELAY autolearn=ham version=3.3.2 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 (AES256-SHA encrypted) ESMTPS; Thu, 13 Feb 2014 16:34:05 +0000 Received: from acsinet21.oracle.com (acsinet21.oracle.com [141.146.126.237]) by aserp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id s1DGY2Yb024423 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Thu, 13 Feb 2014 16:34:03 GMT Received: from aserz7022.oracle.com (aserz7022.oracle.com [141.146.126.231]) by acsinet21.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id s1DGY1he013906 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Thu, 13 Feb 2014 16:34:02 GMT Received: from abhmp0004.oracle.com (abhmp0004.oracle.com [141.146.116.10]) by aserz7022.oracle.com (8.14.4+Sun/8.14.4) with ESMTP id s1DGY1PF024996 for ; Thu, 13 Feb 2014 16:34:01 GMT Received: from termi.oracle.com (/10.175.5.74) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Thu, 13 Feb 2014 08:34:01 -0800 From: jose.marchesi@oracle.com (Jose E. Marchesi) To: gdb-patches@sourceware.org Subject: [PATCH][SPARC64] Fix invalid offsets to access fpregset_t Date: Thu, 13 Feb 2014 16:34:00 -0000 Message-ID: <874n439dgk.fsf@oracle.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-IsSubscribed: yes X-SW-Source: 2014-02/txt/msg00471.txt.bz2 Hi. I noticed that the %fsr register is not being properly accessed from gdb in sparc64. This is because sparc64_supply_fpregset and sparc64_collect_fpregset are using the offsets from the sparc32_bsd_fpregset constant instead of sparc64_bsd_fpregset. How to reproduce the problem: set %f32 to some value and see how $fsr is modified as well. Also, execute a FCMP* instruction (if (myfloat > 3.14)) and see how $fsr does not change to reflect the fp condition codes. I checked and the BSD sparc64 targets are using the proper offsets. Ditto for the linux sparc32 target. This little patch fixes this problem. No noticeable regressions running the test suite. Ok to apply? 2014-02-13 Jose E. Marchesi * sparc64-linux-nat.c (_initialize_sparc64_linux_nat): Register the proper offsets to access fpregset_t. diff --git a/gdb/sparc64-linux-nat.c b/gdb/sparc64-linux-nat.c index a18da3a..80411dc 100644 --- a/gdb/sparc64-linux-nat.c +++ b/gdb/sparc64-linux-nat.c @@ -80,6 +80,8 @@ _initialize_sparc64_linux_nat (void) /* Fill in the generic GNU/Linux methods. */ t = linux_target (); + sparc_fpregset = &sparc64_bsd_fpregset; + /* Add our register access methods. */ t->to_fetch_registers = sparc_fetch_inferior_registers; t->to_store_registers = sparc_store_inferior_registers;