From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 2519 invoked by alias); 19 May 2014 06:47:57 -0000 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 Received: (qmail 2466 invoked by uid 89); 19 May 2014 06:47:56 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-4.4 required=5.0 tests=AWL,BAYES_00,RP_MATCHES_RCVD,SPF_HELO_PASS,SPF_PASS autolearn=ham version=3.3.2 X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 19 May 2014 06:47:55 +0000 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id s4J6lrVc021956 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 19 May 2014 02:47:53 -0400 Received: from host2.jankratochvil.net (ovpn-116-107.ams2.redhat.com [10.36.116.107]) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id s4J6lnrE002691 (version=TLSv1/SSLv3 cipher=AES128-GCM-SHA256 bits=128 verify=NO); Mon, 19 May 2014 02:47:52 -0400 Date: Mon, 19 May 2014 06:47:00 -0000 From: Jan Kratochvil To: Yao Qi Cc: Tom Tromey , gdb-patches@sourceware.org Subject: Re: [PATCH 07/14] add infcall_mmap and gcc_target_options gdbarch methods Message-ID: <20140519064749.GA20403@host2.jankratochvil.net> References: <1400253995-12333-1-git-send-email-tromey@redhat.com> <1400253995-12333-8-git-send-email-tromey@redhat.com> <5379A051.9040209@codesourcery.com> <20140519064019.GA19564@host2.jankratochvil.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20140519064019.GA19564@host2.jankratochvil.net> User-Agent: Mutt/1.5.23 (2014-03-12) X-IsSubscribed: yes X-SW-Source: 2014-05/txt/msg00327.txt.bz2 On Mon, 19 May 2014 08:40:19 +0200, Jan Kratochvil wrote: > On Mon, 19 May 2014 08:10:25 +0200, Yao Qi wrote: > > > +# Return string (caller has to use xfree for it) with options for GCC > > > +# to produce code for this target, typically "-m64", "-m32" or "-m31". > > > +# These options are put before CU's DW_AT_producer compilation options so that > > > +# they can override it. Method may also return NULL. > > > +m:char *:gcc_target_options:void:::default_gcc_target_options::0 > > > EOF > > > } > > > > I doubt the interface like this is sufficient for other archs, like > > arm and mips, which have multiple multilibs, such as -marm/thumb, > > -mfloat-abi={hard,softfp}, etc. This hook in GDB has to take something > > into account, such as gdbarch, current frame, the related bfd, etc, in > > order to return a correct or compatible options for gcc to compile > > source. > > It already already takes 'gdbarch' as its parameter. If it is not enough some > more parameters can be added. But IMO those should be added only when this > method gets implemented for arch which needs such parameter. Oh, you maybe mean that default_gcc_target_options should just error() out as the default implementation does not work for many existing archs. And only tested archs should get implemented their gcc_target_options (even if they look as the current default_gcc_target_options). I was considering it but I was expecting 99% of arch will look the same but if it is not the case the default really can be error(). Jan