From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 30691 invoked by alias); 19 Sep 2007 13:31:46 -0000 Received: (qmail 30541 invoked by uid 22791); 19 Sep 2007 13:31:45 -0000 X-Spam-Check-By: sourceware.org Received: from NaN.false.org (HELO nan.false.org) (208.75.86.248) by sourceware.org (qpsmtpd/0.31) with ESMTP; Wed, 19 Sep 2007 13:31:39 +0000 Received: from nan.false.org (localhost [127.0.0.1]) by nan.false.org (Postfix) with ESMTP id B394E98298; Wed, 19 Sep 2007 13:31:37 +0000 (GMT) Received: from caradoc.them.org (22.svnf5.xdsl.nauticom.net [209.195.183.55]) by nan.false.org (Postfix) with ESMTP id 7E9E698152; Wed, 19 Sep 2007 13:31:37 +0000 (GMT) Received: from drow by caradoc.them.org with local (Exim 4.67) (envelope-from ) id 1IXzeS-0007pw-Nu; Wed, 19 Sep 2007 09:31:36 -0400 Date: Wed, 19 Sep 2007 14:06:00 -0000 From: Daniel Jacobowitz To: Vladimir Prus Cc: gdb@sources.redhat.com Subject: Re: m68k structure return register Message-ID: <20070919133136.GA29941@caradoc.them.org> Mail-Followup-To: Vladimir Prus , gdb@sources.redhat.com References: <200706201325.07067.vladimir@codesourcery.com> <200709191224.28030.vladimir@codesourcery.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200709191224.28030.vladimir@codesourcery.com> User-Agent: Mutt/1.5.15 (2007-04-09) X-IsSubscribed: yes Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org X-SW-Source: 2007-09/txt/msg00149.txt.bz2 On Wed, Sep 19, 2007 at 12:24:27PM +0400, Vladimir Prus wrote: > > Group I -- monitor.mt -- just m68k-tdep.c > > > > 1. m68k-*-aout* a1 > > 2. m68k-*-coff* a1 > > 3. m68k-*-elf* a0 > > 6. m68k-*-uclinuxoldabi* a0 > > 7. m68k-*-uclinux* a1 > > 9. m68k-*-rtems* a0 > > > > In gdb, all target here use the register set in m68k_gdbarch_init -- > > currently A1, which register is wrong for half of targets. I'll get to this > > group shortly. Which of these are ELF? I know RTEMS is; I suspect both uclinuxoldabi and uclinux are. You can differentiate based on ELF-ness in m68k_gdbarch_init. Lots of other targets do that too. Then you can set the default to a1 for non-ELF and a0 for ELF, and that will fix m68k-elf and m68k-rtems without breaking m68k-aout or m68k-coff. m68k-uclinux and m68k-uclinuxoldabi are harder. Do you know how old m68k-uclinuxoldabi is, and whether we need to support it in GDB? If not, you can treat it just like m68k-linux. It is likely that the Linux OS/ABI sniffer will already accept uClinux binaries. > > The problem is therefore, group I. Notably, for m68k-elf gcc uses > > a0, whereas gdb assumes a1. And for m68k-elf, we cannot set > > any osabi sniffer. I think that nowdays m68k-elf is probably the most > > important target in that group. > > > > I would suggest the following: > > > > 1. Change gdb's default to use a0 register, so that bare-metal works. > > 2. If possible, add osabi sniffers to uclinux, openbsdb and rtems, that > > will cause gdb to use a1. OpenBSD is easy. Shouldn't RTEMS use a0, from your tables above? -- Daniel Jacobowitz CodeSourcery