From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 28084 invoked by alias); 25 Nov 2001 17:04:13 -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 27688 invoked from network); 25 Nov 2001 17:02:54 -0000 Received: from unknown (HELO devserv.devel.redhat.com) (199.183.24.200) by sourceware.cygnus.com with SMTP; 25 Nov 2001 17:02:54 -0000 Received: (from jakub@localhost) by devserv.devel.redhat.com (8.11.0/8.11.0) id fAPH2ot00377; Sun, 25 Nov 2001 12:02:50 -0500 Date: Sat, 10 Nov 2001 16:41:00 -0000 From: Jakub Jelinek To: ac131313@cygnus.com, gdb-patches@sources.redhat.com Subject: Re: [PATCH] Fix sparc-*-linux register fetching/storing Message-ID: <20011125120250.D4087@devserv.devel.redhat.com> Reply-To: Jakub Jelinek References: <20011123154220.A562@sunsite.ms.mff.cuni.cz> <20011125020147.A32180@nevyn.them.org> <20011125113201.C4087@devserv.devel.redhat.com> <20011125115446.A15038@nevyn.them.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: <20011125115446.A15038@nevyn.them.org>; from drow@mvista.com on Sun, Nov 25, 2001 at 11:54:46AM -0500 X-SW-Source: 2001-11/txt/msg00211.txt.bz2 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. > 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)); Jakub