From mboxrd@z Thu Jan 1 00:00:00 1970 From: Daniel Jacobowitz To: Andrew Cagney Cc: Jakub Jelinek , gdb-patches@sources.redhat.com Subject: Re: [PATCH] Fix sparc-*-linux register fetching/storing Date: Mon, 26 Nov 2001 12:04:00 -0000 Message-id: <20011126150435.A6212@nevyn.them.org> References: <20011123154220.A562@sunsite.ms.mff.cuni.cz> <20011125020147.A32180@nevyn.them.org> <20011125113201.C4087@devserv.devel.redhat.com> <20011125115446.A15038@nevyn.them.org> <3C02795A.9000104@cygnus.com> X-SW-Source: 2001-11/msg00453.html On Mon, Nov 26, 2001 at 12:18:18PM -0500, Andrew Cagney wrote: > > > >Well, regcache_collect is the only approved interface to the contents > >of registers[] for one thing. 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? > > That sounds like overkill. If you need to be doing sign/zero extension > stuff then I'd be looking at explicit calls to extract_signed_integer() > and/or extract_unsigned_integer() in the nat code. > > A sequence like: > > void *buf = alloca (MAX_REGISTER_RAW_SIZE); > regcache_collect (my reg, buf); > LONGEST val = extract_unsigned_integer (buf, REGISTER_RAW_SIZE(my reg)); > store_unsigned_integer (dest, dest size, val); > > should insulate it from the current problems. But won't we want this absolutely every time we extract a CORE_ADDR? And for that matter, I'm talking about getting a target memory address out of a register; is store_*signed_integer right for that? Is there an extract_pointer or so? -- Daniel Jacobowitz Carnegie Mellon University MontaVista Software Debian GNU/Linux Developer From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 30052 invoked by alias); 26 Nov 2001 20:04:31 -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 29986 invoked from network); 26 Nov 2001 20:04:22 -0000 Received: from unknown (HELO nevyn.them.org) (128.2.145.6) by hostedprojects.ges.redhat.com with SMTP; 26 Nov 2001 20:04:22 -0000 Received: from drow by nevyn.them.org with local (Exim 3.32 #1 (Debian)) id 168RzX-0001cW-00; Mon, 26 Nov 2001 15:04:35 -0500 Date: Mon, 12 Nov 2001 18:40:00 -0000 From: Daniel Jacobowitz To: Andrew Cagney Cc: Jakub Jelinek , gdb-patches@sources.redhat.com Subject: Re: [PATCH] Fix sparc-*-linux register fetching/storing Message-ID: <20011126150435.A6212@nevyn.them.org> Mail-Followup-To: Andrew Cagney , Jakub Jelinek , 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> <3C02795A.9000104@cygnus.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <3C02795A.9000104@cygnus.com> User-Agent: Mutt/1.3.23i X-SW-Source: 2001-11/txt/msg00238.txt.bz2 Message-ID: <20011112184000.kSlbKrTgOzUxK67PaNIIOhDbmlEXULDuRzCBBRpdDDU@z> On Mon, Nov 26, 2001 at 12:18:18PM -0500, Andrew Cagney wrote: > > > >Well, regcache_collect is the only approved interface to the contents > >of registers[] for one thing. 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? > > That sounds like overkill. If you need to be doing sign/zero extension > stuff then I'd be looking at explicit calls to extract_signed_integer() > and/or extract_unsigned_integer() in the nat code. > > A sequence like: > > void *buf = alloca (MAX_REGISTER_RAW_SIZE); > regcache_collect (my reg, buf); > LONGEST val = extract_unsigned_integer (buf, REGISTER_RAW_SIZE(my reg)); > store_unsigned_integer (dest, dest size, val); > > should insulate it from the current problems. But won't we want this absolutely every time we extract a CORE_ADDR? And for that matter, I'm talking about getting a target memory address out of a register; is store_*signed_integer right for that? Is there an extract_pointer or so? -- Daniel Jacobowitz Carnegie Mellon University MontaVista Software Debian GNU/Linux Developer