From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 17082 invoked by alias); 28 Apr 2009 21:31:35 -0000 Received: (qmail 17066 invoked by uid 22791); 28 Apr 2009 21:31:30 -0000 X-SWARE-Spam-Status: No, hits=-2.4 required=5.0 tests=AWL,BAYES_00 X-Spam-Check-By: sourceware.org Received: from rock.gnat.com (HELO rock.gnat.com) (205.232.38.15) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 28 Apr 2009 21:31:24 +0000 Received: from localhost (localhost.localdomain [127.0.0.1]) by filtered-rock.gnat.com (Postfix) with ESMTP id 9D5B92BAC80; Tue, 28 Apr 2009 17:31:22 -0400 (EDT) Received: from rock.gnat.com ([127.0.0.1]) by localhost (rock.gnat.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id DzCI-aiACmWU; Tue, 28 Apr 2009 17:31:22 -0400 (EDT) Received: from joel.gnat.com (localhost.localdomain [127.0.0.1]) by rock.gnat.com (Postfix) with ESMTP id 6490B2BAC35; Tue, 28 Apr 2009 17:31:22 -0400 (EDT) Received: by joel.gnat.com (Postfix, from userid 1000) id 18A15F5924; Tue, 28 Apr 2009 14:31:18 -0700 (PDT) Date: Tue, 28 Apr 2009 21:31:00 -0000 From: Joel Brobecker To: Aleksandar Ristovski Cc: gdb-patches@sources.redhat.com Subject: Re: [patch] use .gnu.attributes to detect e500 machine type Message-ID: <20090428213118.GH31821@adacore.com> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.18 (2008-05-17) Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2009-04/txt/msg00771.txt.bz2 Hello Aleksandar, I wish someone more familiar with the PPC architecture had some time to review your patch. In the meantime, I'll trust your knowledge of the PPC; but it's nice to see that the current code seems to confirm what you said :) > It also introduces a function for "show powerpc vector-abi" to print both > ABI being used and if different, global setting (output can be seen > below). This could be a separate patch - let me know if you want it > separately. I think it would make sense to separate this part, especially since I don't understand what you're trying to do, yet. Perhaps we'll need to start doing something like what we do for "set/show lang ...", but we can discuss this relatively minor part separately. > * rs6000-tdep.c (rs6000_gdbarch_init): Use .gnu.attributes to see > if this is a e500 binary (with SPE APU). > (powerpc_show_vector_abi): New function. If you look at today's version of rs6000_gdbarch_init, you'll find that we're already checking the Tag_GNU_Power_ABI_Vector, and setting the tdep->vector_abi accordingly. It's actually conditionalized on HAVE_ELF, so we need at least to make sure that your testing of the .gnu.attributes sections gets conditionalized on HAVE_ELF as well. However, I am wondering if it wouldn't be better to simply take advantage of the code that's already there. For that, you'll need to move the code up a bit, so that vector_abi gets set earlier. You can then use the resulting information to determine whether or not to fallback on the current approach of using .PPC.EMB.apuinfo. What do you think? -- Joel