From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 29628 invoked by alias); 25 Nov 2001 17:08:26 -0000 Mailing-List: contact gdb-patches-help@sourceware.cygnus.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sources.redhat.com Received: (qmail 29593 invoked from network); 25 Nov 2001 17:08:25 -0000 Received: from unknown (HELO nevyn.them.org) (128.2.145.6) by sourceware.cygnus.com with SMTP; 25 Nov 2001 17:08:25 -0000 Received: from drow by nevyn.them.org with local (Exim 3.32 #1 (Debian)) id 1682lj-00045j-00; Sun, 25 Nov 2001 12:08:39 -0500 Date: Sat, 10 Nov 2001 16:42:00 -0000 From: Daniel Jacobowitz To: Jakub Jelinek Cc: ac131313@cygnus.com, gdb-patches@sources.redhat.com Subject: Re: [PATCH] Fix sparc-*-linux register fetching/storing Message-ID: <20011125120839.A15648@nevyn.them.org> Mail-Followup-To: Jakub Jelinek , ac131313@cygnus.com, gdb-patches@sources.redhat.com References: <20011123154220.A562@sunsite.ms.mff.cuni.cz> <20011125020147.A32180@nevyn.them.org> <20011125113201.C4087@devserv.devel.redhat.com> <20011125115446.A15038@nevyn.them.org> <20011125120250.D4087@devserv.devel.redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20011125120250.D4087@devserv.devel.redhat.com> User-Agent: Mutt/1.3.23i X-SW-Source: 2001-11/txt/msg00212.txt.bz2 On Sun, Nov 25, 2001 at 12:02:50PM -0500, Jakub Jelinek wrote: > On Sun, Nov 25, 2001 at 11:54:46AM -0500, Daniel Jacobowitz wrote: > > Well, regcache_collect is the only approved interface to the contents > > of registers[] for one thing. > > Even in the routine where half of it is direct registers[] setting? > If that is rewritten, surely it makes sense to access sp that way too. Yes. Accessing registers[] is deprecated. > > It would also prevent the need for the > > cast (although you'd have to clear the upper half of the variable > > first and make sure to stuff it into the low bytes since we're > > big-endian. Ew.). > > > > Andrew? Do we need to have a regcache_collect_core_addr, to sign > > extend and shift appropriately for each architecture? > > Without such routine the code would be very ugly: > CORE_ADDR sp = 0; > regcache_collect (SP_REGNUM, ((char *)&sp) + sizeof(CORE_ADDR) - REGISTER_RAW_SIZE(SP_REGNUM)); I guess we do, then :) I'll wait for Andrew's thoughts, this is his turf. But other than this, your patch looks good. Since Sparc is listed as maintenance only (i.e. no active maintainer), you can go ahead and commit it, I think; we'll clean up the registers[] stuff later. -- Daniel Jacobowitz Carnegie Mellon University MontaVista Software Debian GNU/Linux Developer