From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 23020 invoked by alias); 22 Apr 2003 19:30:23 -0000 Mailing-List: contact gdb-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sources.redhat.com Received: (qmail 23011 invoked from network); 22 Apr 2003 19:30:23 -0000 Received: from unknown (HELO crack.them.org) (65.125.64.184) by sources.redhat.com with SMTP; 22 Apr 2003 19:30:23 -0000 Received: from nevyn.them.org ([66.93.61.169] ident=mail) by crack.them.org with asmtp (Exim 3.12 #1 (Debian)) id 1983TN-0004zO-00; Tue, 22 Apr 2003 14:30:33 -0500 Received: from drow by nevyn.them.org with local (Exim 3.36 #1 (Debian)) id 1983T4-0006dV-00; Tue, 22 Apr 2003 15:30:14 -0400 Date: Tue, 22 Apr 2003 19:30:00 -0000 From: Daniel Jacobowitz To: Kris Warkentin Cc: gdb@sources.redhat.com Subject: Re: long long considered harmful? Message-ID: <20030422193013.GA25488@nevyn.them.org> Mail-Followup-To: Kris Warkentin , gdb@sources.redhat.com References: <076701c308f6$2f017eb0$0202040a@catdog> <20030422174522.GA728@nevyn.them.org> <080801c30903$2dc0ae60$0202040a@catdog> <081f01c30904$ea5b7f90$0202040a@catdog> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <081f01c30904$ea5b7f90$0202040a@catdog> User-Agent: Mutt/1.5.1i X-SW-Source: 2003-04/txt/msg00256.txt.bz2 On Tue, Apr 22, 2003 at 03:25:21PM -0400, Kris Warkentin wrote: > > > > typedef struct mips_cpu_registers > > > > { > > > > unsigned regs[74]; > > > > unsigned long long regs_alignment; > > > > } MIPS_CPU_REGISTERS; > > > > > > What's the purpose of the alignment entry? I doubt it does what you > > > want it to. > > > > I was more or less correct on this one. Apparently this was not even > > defined by us but by one of our very large chip vendors who shall remain > > nameless. Rather than the nicer solution of just defining an array of 64 > > bit regs, they did this which necessitates some nastiness when dealing > with > > different endians. The alignment field ensures that the overall structure > > is 64 bit aligned which is a handy thing to be on mips. > > Pardon me, by overall structure, I mean the starting address of the > structure. Having a 64 bit entry causes the compiler to align the structure > on a 64 bit boundary. Whoever told you this is mistaken. A long long member of a structure only has four byte alignment on i386-linux, for example. That's mandated by the psABI. This is exactly one of those reasons why you can not use structures on the host to describe data on the target. -- Daniel Jacobowitz MontaVista Software Debian GNU/Linux Developer