From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 25989 invoked by alias); 22 Apr 2004 21:29:20 -0000 Mailing-List: contact gdb-patches-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sources.redhat.com Received: (qmail 25982 invoked from network); 22 Apr 2004 21:29:19 -0000 Received: from unknown (HELO nevyn.them.org) (66.93.172.17) by sources.redhat.com with SMTP; 22 Apr 2004 21:29:19 -0000 Received: from drow by nevyn.them.org with local (Exim 4.32 #1 (Debian)) id 1BGlkz-0006S4-Om; Thu, 22 Apr 2004 17:29:17 -0400 Date: Thu, 22 Apr 2004 21:29:00 -0000 From: Daniel Jacobowitz To: Andrew Cagney Cc: Michael Snyder , gdb-patches@sources.redhat.com, cagney Subject: Re: [RFA] mips 32/64 register/stack fix Message-ID: <20040422212917.GA24441@nevyn.them.org> Mail-Followup-To: Andrew Cagney , Michael Snyder , gdb-patches@sources.redhat.com, cagney References: <408813A9.6000402@redhat.com> <4088242A.4070601@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4088242A.4070601@gnu.org> User-Agent: Mutt/1.5.5.1+cvs20040105i X-SW-Source: 2004-04/txt/msg00545.txt.bz2 On Thu, Apr 22, 2004 at 03:59:38PM -0400, Andrew Cagney wrote: > >! if (mips_saved_regsize (tdep) < mips_regsize (gdbarch) && > >! trad_frame_addr_p (info->saved_regs, regnum)) > >! { > > This doesn't look right, can you post a backtrace? > > The MIPS has [0 .. NUM_REGS) ISA sized registers and [NUM_REGS .. > 2*NUM_REGS) ABI sized registers. So if the caller wants an ABI register > it should have passed in that register number. Personally, I think the mistake is higher up - in mips_regsize or further. Look at this: int mips_regsize (struct gdbarch *gdbarch) { return (gdbarch_bfd_arch_info (gdbarch)->bits_per_word / gdbarch_bfd_arch_info (gdbarch)->bits_per_byte); } bits_per_word is based on the BFD architecture, which is based on EF_MIPS_MACH and EF_MIPS_ARCH. I don't think it's useful to have -mcpu=mips64 -mabi=32 code (which is pretty much what Michael's describing) behave differently from -mcpu=mips1 -mabi=32 code; a native GNU/Linux GDB has to deal with 32-bit target registers and 32-bit saved registers in either case. And that's what you get if you build the optimal compiler for a 32-bit kernel on a 64-bit processor, which lots of people do. It's very easy to reproduce this problem if you have access to anything that can run a MIPS64 GNU/Linux kernel. Build an n32 GDB, run it using --target_board unix/-mabi=32/-mcpu=mips64, IIRC. I have a collection of hacks to work around this and they're gross beyond all description, which is why I tabled them until after I sort through the prologue analysis issues. -- Daniel Jacobowitz MontaVista Software Debian GNU/Linux Developer