From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 28821 invoked by alias); 19 May 2014 06:41:19 -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 28812 invoked by uid 89); 19 May 2014 06:41:19 -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:41:18 +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 s4J6eTde013626 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 19 May 2014 02:40:32 -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 s4J6eJxZ000544 (version=TLSv1/SSLv3 cipher=AES128-GCM-SHA256 bits=128 verify=NO); Mon, 19 May 2014 02:40:21 -0400 Date: Mon, 19 May 2014 06:41: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: <20140519064019.GA19564@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> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <5379A051.9040209@codesourcery.com> User-Agent: Mutt/1.5.23 (2014-03-12) X-IsSubscribed: yes X-SW-Source: 2014-05/txt/msg00326.txt.bz2 On Mon, 19 May 2014 08:10:25 +0200, Yao Qi wrote: > > +# Allocate SIZE bytes of PROT protected page aligned memory in inferior. > > +# PROT has rwx bitmask format - bit 2 (value 4) is for readable memory, bit 1 > > +# (value 2) is for writable memory and bit 0 (value 1) is for executable memory. > > +# Throw an error if it is not possible. Returned address is always valid. > > +f:CORE_ADDR:infcall_mmap:CORE_ADDR size, unsigned prot:size, prot::default_infcall_mmap::0 > > + > > .... looks this hook is to allocate some target memory pages with > certain required permissions. Probably, we can use "allocate_memory" > or "mmap". I am then for plain "mmap". "allocate_memory" suggests me more malloc(). > > +# 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. Thanks, Jan