From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 26297 invoked by alias); 21 Aug 2015 09:49:40 -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 26279 invoked by uid 89); 21 Aug 2015 09:49:38 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.8 required=5.0 tests=AWL,BAYES_00,KAM_LAZY_DOMAIN_SECURITY,RP_MATCHES_RCVD,SPF_HELO_PASS autolearn=no 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 (AES256-GCM-SHA384 encrypted) ESMTPS; Fri, 21 Aug 2015 09:49:37 +0000 Received: from int-mx13.intmail.prod.int.phx2.redhat.com (int-mx13.intmail.prod.int.phx2.redhat.com [10.5.11.26]) by mx1.redhat.com (Postfix) with ESMTPS id 93EB78E74A; Fri, 21 Aug 2015 09:49:36 +0000 (UTC) Received: from [127.0.0.1] (ovpn01.gateway.prod.ext.ams2.redhat.com [10.39.146.11]) by int-mx13.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id t7L9nY7S004578; Fri, 21 Aug 2015 05:49:34 -0400 Message-ID: <55D6F42D.2080009@redhat.com> Date: Fri, 21 Aug 2015 09:49:00 -0000 From: Pedro Alves User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.5.0 MIME-Version: 1.0 To: Marc Gauthier , Max Filippov , Joel Brobecker CC: "gdb-patches@sourceware.org" , Maxim Grigoriev , Woody LaRue Subject: Re: [PATCH v2] xtensa: initialize call_abi in xtensa_tdep References: <1440075160-13310-1-git-send-email-jcmvbkbc@gmail.com> <20150820130736.GF4571@adacore.com> <55D5E088.3050807@redhat.com> In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-SW-Source: 2015-08/txt/msg00566.txt.bz2 On 08/20/2015 09:30 PM, Marc Gauthier wrote: > Pedro Alves wrote: >> On 08/20/2015 02:37 PM, Max Filippov wrote: >> >>> Actually it's as simple as unpacking a tarball to the source directory, >>> and we have it automated in the environments that build toolchains, >>> like the Buildroot or the crosstool-NG. >>> >>> The idea behind this is the following: Xtensa core is configurable, a >> lot >>> of its properties may be changed. Nobody even try to test all possible >>> combinations of configuration options and nobody really cares how many >>> Xtensa core configurations exist, people that generate Xtensa core >>> only care about their particular core. When they generate it they get >>> all the files that need to be changed in the toolchain, they apply them >>> and they get the toolchain for their particular core. >> >> How about making the configuration generator tool output some data >> file that gdb would source? > > As I understand it, a simple data file is problematic. For example, > customers adding custom extensions to an Xtensa processor can describe > instruction operand encoding and decoding using arbitrary verilog > expressions. Although typically simple, there is currently no constraint > on these expressions, so to fully support this, they get translated into > C code which GDB and other tools can use to assemble and disassemble > Xtensa instructions. Does that mean you're replacing some src/opcodes/ files too, for disassembly? > So the more natural "data file" to describe a custom processor is a shared > library or DLL. Another option would be some Python API. > This is what Cadence's Tensilica tools use. However, in > the far past, upstreaming this approach was problematic given the various > projects' aversion to dynamic shared libraries, which aren't supported > on every host architecture (not all support a dlopen equivalent). > That's not really a problem. Hosts that can't dlopen just don't support all features. From https://sourceware.org/gdb/wiki/Systems, probably the only one would be MSDOS/djgpp. E.g., GDB already supports a JIT debug info reader API, which loads a shared library plugin into GDB. https://sourceware.org/gdb/onlinedocs/gdb/Writing-JIT-Debug-Info-Readers.html Another example, GDB loads a libcc1.so library in order to invoke gcc, in order to provide the new "compile" set of subcommands. GCC is also extensible with plugins nowadays. That's what the libcc1.so library talks to -- a gcc plugin. The binutils ld linker has a plugin interface, for loading the LTO plugin. > Might it be possible now to introduce use of a dynamic shared library? I think it'd be useful to see a couple representative diffs of pristine FSF GDB vs a configured GDB, to get a better feel for what needs exposing. > If that works for GDB, my next question will be about binutils and gcc :-) Thanks, Pedro Alves