From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 122932 invoked by alias); 17 Apr 2015 17:24:34 -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 122919 invoked by uid 89); 17 Apr 2015 17:24:33 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=AWL,BAYES_00,SPF_HELO_PASS,SPF_PASS,T_RP_MATCHES_RCVD 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 (AES256-GCM-SHA384 encrypted) ESMTPS; Fri, 17 Apr 2015 17:24:32 +0000 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id t3HHOPXb023170 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Fri, 17 Apr 2015 13:24:25 -0400 Received: from [127.0.0.1] (ovpn01.gateway.prod.ext.ams2.redhat.com [10.39.146.11]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id t3HHOJ52013909; Fri, 17 Apr 2015 13:24:20 -0400 Message-ID: <553141C3.3040101@redhat.com> Date: Fri, 17 Apr 2015 17:24: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: Max Filippov CC: gdb-patches@sourceware.org, Maxim Grigoriev , Woody LaRue , Marc Gauthier , "linux-xtensa@linux-xtensa.org" , Baruch Siach Subject: Re: [PATCH] gdb: fix xtensa build with custom overlay References: <1429287116-20216-1-git-send-email-jcmvbkbc@gmail.com> <55313315.1010203@redhat.com> In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-SW-Source: 2015-04/txt/msg00698.txt.bz2 On 04/17/2015 05:45 PM, Max Filippov wrote: > On Fri, Apr 17, 2015 at 7:21 PM, Pedro Alves wrote: >> On 04/17/2015 05:11 PM, Max Filippov wrote: >>> The commit 14e361d7aa3bbd8601b0457ee8558344e444c651 ("xtensa-config.c: >>> missing defs.h include") fixed the build of default xtensa configuration >>> by including defs.h in the beginning of xtensa-config.c. Unfortunately >>> this fix doesn't work when gdb is configured for another xtensa core, as >>> the file xtensa-config.c is a part of configuration overlay and it gets >>> overwritten. To fix the build for all existing configurations include >>> defs.h into gdb/xtensa-tdep.h, where the issue (reference to undeclared >>> uint32_t) actually is. >> >> Hmm, I think that's news to me. Can you please expand a bit >> on why is this mechanism necessary? > > xtensa cores may have greatly varying register and instruction sets, > depending on options configured at processor creation time. So parts > of gdb that deal with registers and instructions are generated during > processor build and need to be replaced in the gdb source code to > produce gdb that can work with a particular xtensa core. > >> In any case, that mechanism must already by outputting: >> >> #include "xtensa-config.h" >> #include "xtensa-tdep.h" >> >> Just make it output #include "defs.h" as well? > > Yes, that can be done for the newly generated files, but there are existing > configuration overlays which we need to patch in this case. It can be done, > it's just much more changes. I don't know about much more changes. We really shouldn't promise not to break out-of-tree changes. The point is this is quite brittle, and I think as is, the onus should be on you to keep it working. Nothing tells us that we might want or need to do an across-the-tree change that breaks all this. For example, for the ongoing C++ conversion. It seems that the best solution would be to design a mechanism to load this information into gdb dynamically, either through the xml target description mechanism, or through some new Python hook that reads an xtensa-specific description file. Thanks, Pedro Alves