From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 20671 invoked by alias); 26 Nov 2001 20:34:42 -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 20649 invoked from network); 26 Nov 2001 20:34:41 -0000 Received: from unknown (HELO localhost.cygnus.com) (24.147.211.196) by hostedprojects.ges.redhat.com with SMTP; 26 Nov 2001 20:34:41 -0000 Received: from cygnus.com (localhost [127.0.0.1]) by localhost.cygnus.com (Postfix) with ESMTP id 51A1F3DBA; Mon, 26 Nov 2001 15:34:41 -0500 (EST) Message-ID: <3C02A761.4030003@cygnus.com> Date: Mon, 12 Nov 2001 19:11:00 -0000 From: Andrew Cagney User-Agent: Mozilla/5.0 (X11; U; NetBSD macppc; en-US; rv:0.9.3) Gecko/20011020 X-Accept-Language: en-us MIME-Version: 1.0 To: Daniel Jacobowitz Cc: Jakub Jelinek , gdb-patches@sources.redhat.com Subject: Re: [PATCH] Fix sparc-*-linux register fetching/storing 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> <20011126150435.A6212@nevyn.them.org> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-SW-Source: 2001-11/txt/msg00239.txt.bz2 Message-ID: <20011112191100.-1C6bUC_bgs8XEHV3xQOvPqoTKMjAJpafYLlO_kHlwg@z> >> 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? In *-nat.c? Now I'm confused :-) Doesn't the *-nat.c file just copy raw register bytes between the regcache and the /proc or ptrace() interface? The only complication I could see is if someone used 32 bit ptrace calls to get the values for a regcache that had space for 64 bit registers - the above code snipit would handle that. The reason for suggesting extract/store signed/unsigned integer is that they have clear, machine independant, semantics that work on uninterpreted (well apart from assuming they are integers :-) bytes. ? Andrew