From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 14037 invoked by alias); 28 Nov 2006 17:17:14 -0000 Received: (qmail 13953 invoked by uid 22791); 28 Nov 2006 17:17:03 -0000 X-Spam-Check-By: sourceware.org Received: from nevyn.them.org (HELO nevyn.them.org) (66.93.172.17) by sourceware.org (qpsmtpd/0.31.1) with ESMTP; Tue, 28 Nov 2006 17:16:43 +0000 Received: from drow by nevyn.them.org with local (Exim 4.63) (envelope-from ) id 1Gp6ZV-0005yB-IQ; Tue, 28 Nov 2006 12:16:41 -0500 Date: Tue, 28 Nov 2006 17:17:00 -0000 From: Daniel Jacobowitz To: Nick Clifton Cc: gdb-patches@sourceware.org, kevinb@redhat.com Subject: Re: RFA: Fix compile time warnings building iq2000-tdep.c Message-ID: <20061128171641.GF21834@nevyn.them.org> Mail-Followup-To: Nick Clifton , gdb-patches@sourceware.org, kevinb@redhat.com References: <20061128164758.GC20882@nevyn.them.org> <456C6BC3.3090006@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <456C6BC3.3090006@redhat.com> User-Agent: Mutt/1.5.13 (2006-08-11) X-IsSubscribed: yes 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 X-SW-Source: 2006-11/txt/msg00328.txt.bz2 On Tue, Nov 28, 2006 at 05:02:59PM +0000, Nick Clifton wrote: > + CORE_ADDR dummy; > + union > + { > + gdb_byte bytes[sizeof dummy]; > + CORE_ADDR addr; > + } > + return_buffer; > + > /* Return values > 8 bytes are returned in memory, > pointed to by FN_RETURN_REGNUM. */ > ! regcache_cooked_read (regcache, E_FN_RETURN_REGNUM, > return_buffer.bytes); > ! read_memory (return_buffer.addr, valbuf, TYPE_LENGTH (type)); > } > } > > (Rest of the patch as before). > > This makes the puning of gdb_byte and CORE_ADDR explicit, which I think > is a good thing, but maybe there is a preferred gdb way of doing this ? > (Also I could not think of a clean way of obtaining the size of a > CORE_ADDR without using a dummy variable). If your host and target have different endianness, this isn't going to work so well. And CORE_ADDR may be 32-bit or 64-bit. I suspect that what you really want is extract_typed_address; and to size the buffer according to a target pointer, not according to a CORE_ADDR. -- Daniel Jacobowitz CodeSourcery