From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 8679 invoked by alias); 22 Apr 2003 18:21:58 -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 8664 invoked from network); 22 Apr 2003 18:21:57 -0000 Received: from unknown (HELO crack.them.org) (65.125.64.184) by sources.redhat.com with SMTP; 22 Apr 2003 18:21:57 -0000 Received: from nevyn.them.org ([66.93.61.169] ident=mail) by crack.them.org with asmtp (Exim 3.12 #1 (Debian)) id 1982PD-0004sP-00; Tue, 22 Apr 2003 13:22:11 -0500 Received: from drow by nevyn.them.org with local (Exim 3.36 #1 (Debian)) id 1982Ou-0001tG-00; Tue, 22 Apr 2003 14:21:52 -0400 Date: Tue, 22 Apr 2003 18:21:00 -0000 From: Daniel Jacobowitz To: Kris Warkentin Cc: gdb@sources.redhat.com Subject: Re: long long considered harmful? Message-ID: <20030422182151.GA7232@nevyn.them.org> Mail-Followup-To: Kris Warkentin , gdb@sources.redhat.com References: <076701c308f6$2f017eb0$0202040a@catdog> <20030422174522.GA728@nevyn.them.org> <079701c308fa$3c6d0610$0202040a@catdog> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <079701c308fa$3c6d0610$0202040a@catdog> User-Agent: Mutt/1.5.1i X-SW-Source: 2003-04/txt/msg00252.txt.bz2 On Tue, Apr 22, 2003 at 02:08:54PM -0400, Kris Warkentin wrote: > I didn't write this stuff - it's taken from our system headers > and reflects the way that the kernel stores registers when you ask it to. > > > > > typedef union > > > { > > > unsigned long long u64; > > > double f; > > > } mipsfloat; > > > > This is a target entity isn't it? You've got no business using > > "double" for a target float. Use the gdb type mechanism instead. > > Can you point to an example of how this is done? Check out floatformat_to_doublest. You may not even need it if you only pass the data to supply_register... > > > 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 believe it's padding to handle whether we're dealing with a little or big > endian target. I'll ask the kernel guys when I find them. Regardless of > whether it does anything, the structure has to be the appropriate size for > the kernel to fill in. "Mine is not to reason why, mine is just to do or > die." We're talking about code in the host now though, right? You can not rely on any structure alignment to match. If any of these must match target structures, you must use gdbarch and the type mechanism for them. See gnu-v3-abi.c for an example; or just define the offsets that you need. -- Daniel Jacobowitz MontaVista Software Debian GNU/Linux Developer