From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 28233 invoked by alias); 14 Apr 2009 19:48:03 -0000 Received: (qmail 28223 invoked by uid 22791); 14 Apr 2009 19:48:02 -0000 X-SWARE-Spam-Status: No, hits=-3.1 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_LOW,SPF_HELO_PASS,SPF_PASS X-Spam-Check-By: sourceware.org Received: from main.gmane.org (HELO ciao.gmane.org) (80.91.229.2) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 14 Apr 2009 19:47:55 +0000 Received: from list by ciao.gmane.org with local (Exim 4.43) id 1Ltobn-0006ot-KQ for gdb-patches@sources.redhat.com; Tue, 14 Apr 2009 19:47:51 +0000 Received: from entropy.qnx.com ([209.226.137.107]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 14 Apr 2009 19:47:51 +0000 Received: from aristovski by entropy.qnx.com with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 14 Apr 2009 19:47:51 +0000 To: gdb-patches@sources.redhat.com From: Aleksandar Ristovski Subject: Re: [patch] use .gnu.attributes to detect e500 machine type Date: Tue, 14 Apr 2009 19:48:00 -0000 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit User-Agent: Thunderbird 2.0.0.21 (Windows/20090302) In-Reply-To: X-IsSubscribed: yes 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/msg00279.txt.bz2 any thoughts? Aleksandar Ristovski wrote: > Hello, > > > The patch introduces determining e500 cpu from .gnu.attributes; if gnu > attributes section is not present, fall-back to the old way of checking > the presence of .PPC.EMB.apuinfo section. > > 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. > > Background of the patch: > > Currently, gdb relies on presence .PPC.EMB.apuinfo section. This is not > completely correct since apuinfo section can contain information about > any APU instructions present, and not only SPE. So we could have a > binary with .PPC.EMB.apuinfo section and without SPE APU. Further, > .PPC.EMB.apuinfo may not be present at all even if -me500 is specified. > This is due to gas emitting this section only if it encounters SPE APU > instructions in the assembly. > > .gnu.attributes section records user setting, whether there were SPE > instructions generated or not. We use gnu object attributes in rs6000 > already (for determining vector-abi and float-point abi). > > The only problem with .gnu.attribute is that if binary is compiled with > pre-4.3 gcc, .gnu.attributes section does not get generated at all. > (.gnu_attribute was added in 4.3). This is why we fall-back to > .PPC.EMB.apuinfo presence. > > Results of the patch: > > After starting gdb, no executable: > (gdb) show powerpc vector-abi > The vector ABI in use is "generic". Default setting is "auto". > (gdb) file /mnt/win/ppcspetest_g > Reading symbols from /mnt/win/ppcspetest_g...done. > (gdb) show powerpc vector-abi > The vector ABI in use is "spe". Default setting is "auto". > > ** If user overrides selected vector-abi, this is the display: > (gdb) set powerpc vector-abi generic > (gdb) show powerpc vector-abi > The vector ABI is "generic" > > > "show powerpc vector-abi" will now display both selected vector-abi and > user setting ("Default setting is ..."). Only if the two concide, it > will only say "Target vector ABI is ..."). > > > Thanks, > > Aleksandar Ristovski > QNX Software Systems > > > ChangeLog > * 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. > (_initialize_rs6000_tdep): Use powerpc_show_vector_abi. > >