From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 3095 invoked by alias); 28 May 2002 20:46:46 -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 3062 invoked from network); 28 May 2002 20:46:42 -0000 Received: from unknown (HELO cygnus.com) (205.180.83.203) by sources.redhat.com with SMTP; 28 May 2002 20:46:42 -0000 Received: from romulus.sfbay.redhat.com (romulus.sfbay.redhat.com [172.16.27.251]) by runyon.cygnus.com (8.8.7-cygnus/8.8.7) with ESMTP id NAA13339; Tue, 28 May 2002 13:46:37 -0700 (PDT) Received: (from kev@localhost) by romulus.sfbay.redhat.com (8.11.6/8.11.6) id g4SKkTl29456; Tue, 28 May 2002 13:46:29 -0700 Date: Tue, 28 May 2002 14:12:00 -0000 From: Kevin Buettner Message-Id: <1020528204629.ZM29455@localhost.localdomain> In-Reply-To: Jason R Thorpe "Re: [PATCH/RFA] Generic OS ABI handling for PowerPC" (May 28, 12:52pm) References: <20020528122612.O22765@dr-evil.shagadelic.org> <1020528194109.ZM21642@localhost.localdomain> <20020528125247.P22765@dr-evil.shagadelic.org> To: Jason R Thorpe , Kevin Buettner Subject: Re: [PATCH/RFA] Generic OS ABI handling for PowerPC Cc: gdb-patches@sources.redhat.com MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-SW-Source: 2002-05/txt/msg00981.txt.bz2 On May 28, 12:52pm, Jason R Thorpe wrote: > On Tue, May 28, 2002 at 12:41:09PM -0700, Kevin Buettner wrote: > > > Why did you move the SVR4 ABI stuff out of ppc-linux-tdep.c? I know > > there's a FIXME comment to that effect in this file, but I don't think > > that rs6000-tdep.c is really the right place for for the SVR4 ABI > > code. > > Well, ppc-linux-tdep.c isn't exactly the right place for it, either. Agreed, but I think it's a better place than rs6000-tdep.c. > I could add another ppc-tdep.c file, but it seems to me that as long as > rs6000-tdep.c makes references to sysv abi stuff, it should be actually in > rs6000-tdep.c. Umm... rs6000-tdep.c references ppc_linux_* functions too. Are you suggesting that they too should be moved to rs6000-tdep.c? The way I view it is that (for historical reasons) rs6000-tdep.c contains architecture specific code for the PowerPC and Power architectures. It also contains PowerOpen ABI specific code as well as code specific to the AIX operating system. BTW, the fact that it contains PowerOpen ABI specific code is the reason that I object to moving the SVR4 ABI specific code there. IMO, ideally, the architecture specific code ought to go in it's own file. The ABI-specific code ought to go in separate files of their own and inherit from the arch specific file. The OS-dependent code ought to go in still other files and ought to inherit from the ABI specific code. For the Power/PowerPC targets, I'd like to someday break it down as follows: ppc-tdep.c - generic Power / PowerPC architecture ppc-sysv-tdep.c - PowerPC SysV ABI ppc-eabi-tdep.c - PowerPC EABI ppc-poweropen-tdep.c - Power / PowerPC PowerOpen ABI (or whatever it is that IBM's calling it these days.) ... (maybe more ABI specific files) ppc-linux-tdep.c - Linux specific code for Power/PowerPC ppc-aix-tdep.c - AIX specific code for Power/PowerPC ... (maybe more OS specific files) The gdbarch machinery doesn't yet have an inheritance mechanism, so, unfortunately, we're left with the situation whereby (e.g.) the rs6000_gdbarch_init() function has to refer to a lot of code that it really shouldn't be referring to. It also makes arranging the code as described above somewhat more difficult. Kevin