From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 6650 invoked by alias); 9 Jun 2002 19:32:15 -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 6594 invoked from network); 9 Jun 2002 19:32:11 -0000 Received: from unknown (HELO nevyn.them.org) (66.19.120.21) by sources.redhat.com with SMTP; 9 Jun 2002 19:32:11 -0000 Received: from drow by nevyn.them.org with local (Exim 3.35 #1 (Debian)) id 17H8Mi-0003bQ-00; Sun, 09 Jun 2002 15:28:40 -0400 Date: Sun, 09 Jun 2002 12:32:00 -0000 From: Daniel Jacobowitz To: Andrew Cagney Cc: gdb-patches@sources.redhat.com, cagney@redhat.com Subject: Re: RFA: MIPS ABI selection Message-ID: <20020609192840.GA13703@nevyn.them.org> Mail-Followup-To: Andrew Cagney , gdb-patches@sources.redhat.com, cagney@redhat.com References: <20020609031656.GA2529@nevyn.them.org> <3D03A944.1000704@cygnus.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <3D03A944.1000704@cygnus.com> User-Agent: Mutt/1.5.1i X-SW-Source: 2002-06/txt/msg00153.txt.bz2 I have some comments about this reply, but please read all the way down; most of the comments are academic curiousity. On Sun, Jun 09, 2002 at 03:15:16PM -0400, Andrew Cagney wrote: > >The current state of the world in GCC says: a handful of setups default to > >unique ABIs, but the global default is O32. The default is also to pass no > >ABI flags to the assembler. > > > >elf64.h, iris6.h, isa3264.h, and r3900.h override this. Irix defaults to > >N32 and passing -n32 which presumably tags binaries; plus the irix > >configuration in GDB can handle this. elf64.h does not do pass any flags > >but defaults to O64. isa3264.h defaults to MEABI and appears not to tag > >binaries. r3900.h defaults to EABI and untagged binaries. > > > >That's mipsisa32-*-elf*, mips64*-*-elf*, mipstx39*-*-elf*, > >mips-sgi-irix5cross64, and mips-sgi-irix6*. > > > >So what's a debugger to do? Right now, we try to infer things from our > >header files, but only little details of the ABI. In particular, we never > >infer O32 correctly. Better would be to match GCC; that's quite > >straightforward. > > > >I skipped mipsisa32-*-elf*, because GDB doesn't support MEABI. So this > >patch fixes the defaults for mips64*-*-elf* and mipstx39*-*-elf*, and a > >little tweaking for IRIX. It then adds a global O32 default. In the > >process I found another way that GCC tags binaries with their ABI: a > >".mdebug.abi32", etc. section. I handle that too. All appears to work > >like > >a charm. We even get warnings for MEABI etc. binaries. > > > >Andrew, this look OK? > > Hmm, this contains several changes: > > > -- The function mips_find_abi_section() that better identifies the ABI. > > Yes. This is definitly a good idea and approved. I'll commit it separately in a moment. > -- Adding the macro MIPS_DEFAULT_ABI to all MIPS targets. > > Remember, all the mips/tm-*.h files are going away so this isn't really > going to help. Instead, I think a ``(gdb) set mips abi .. auto o32 > ...'' command would be far more useful. Another place the code could > look is the ABI from the previous architecture. That paragraph is three things: tm-*.h files are going away: Yes, certainly, and when they do they will become OSABIs presumably. Those new places don't exist yet. When they do the default ABI should go in them, and for now I want to put it in the right place so that it will be picked up and moved over when the time is right. What's wrong with that? "set mips abi": Certainly it's useful, but I'd say it was completely unrelated to the purpose of my patch. ABI from the previous architecture: I don't want to do that. I believe that generating a new architecture should be completely independent of the previous architecture. If we figured it out the first time we can figure it out again. > -- Some additional MIPS targets > > Er, we're trying to get the number of MIPS targets down to zero. GCC supports configuring for those targets. Binutils supports configuring those targets. In both cases they get a special default ABI that doesn't match GDB's. I think that makes the new targets quite justified. _HOWEVER_: After I commit the bit to use ".mdebug.abi*" sections, we will always get the ABI for GCC-produced binaries correct, at least as far back as I can find GCC releases. After that point I no longer care what the default case says. How about I just commit the part which says "if no tm- file overrides this, default to O32" and the bit which removes the default case (which accesses a lot of target macros, ew)? -- Daniel Jacobowitz Carnegie Mellon University MontaVista Software Debian GNU/Linux Developer