From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 87371 invoked by alias); 20 Aug 2015 13:37:10 -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 87361 invoked by uid 89); 20 Aug 2015 13:37:09 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=0.4 required=5.0 tests=AWL,BAYES_05,FREEMAIL_FROM,FROM_LOCAL_NOVOWEL,HK_RANDOM_ENVFROM,HK_RANDOM_FROM,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=no version=3.3.2 X-HELO: mail-ob0-f173.google.com Received: from mail-ob0-f173.google.com (HELO mail-ob0-f173.google.com) (209.85.214.173) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-GCM-SHA256 encrypted) ESMTPS; Thu, 20 Aug 2015 13:37:05 +0000 Received: by obbfr1 with SMTP id fr1so31925993obb.1 for ; Thu, 20 Aug 2015 06:37:03 -0700 (PDT) MIME-Version: 1.0 X-Received: by 10.182.129.11 with SMTP id ns11mr2675109obb.3.1440077823110; Thu, 20 Aug 2015 06:37:03 -0700 (PDT) Received: by 10.76.10.196 with HTTP; Thu, 20 Aug 2015 06:37:03 -0700 (PDT) In-Reply-To: <20150820130736.GF4571@adacore.com> References: <1440075160-13310-1-git-send-email-jcmvbkbc@gmail.com> <20150820130736.GF4571@adacore.com> Date: Thu, 20 Aug 2015 13:37:00 -0000 Message-ID: Subject: Re: [PATCH v2] xtensa: initialize call_abi in xtensa_tdep From: Max Filippov To: Joel Brobecker Cc: gdb-patches@sourceware.org, Maxim Grigoriev , Woody LaRue , Marc Gauthier Content-Type: text/plain; charset=UTF-8 X-SW-Source: 2015-08/txt/msg00545.txt.bz2 On Thu, Aug 20, 2015 at 4:07 PM, Joel Brobecker wrote: > On Thu, Aug 20, 2015 at 03:52:40PM +0300, Max Filippov wrote: >> Use XSHAL_ABI value provided by xtensa-config.h to correctly initialize >> xtensa_tdep.call_abi >> This fixes calls to functions from GDB that otherwise fail with the >> following assertion in call0 configuration: >> >> gdb/regcache.c:602: internal-error: regcache_raw_read: Assertion >> `regnum >= 0 && regnum < regcache->descr->nr_raw_registers' failed. >> >> gdb/ >> * xtensa-tdep.h (XTENSA_GDBARCH_TDEP_INSTANTIATE): Initialize >> call_abi using XSHAL_ABI macro. > > I think you missed or ignored one comment about the fact that > the code I am seeing in current xtensa-tdep.h is not what your patch > says. Sorry, I'm not sure what you mean. I've changed call_abi initialization in the macro XTENSA_GDBARCH_TDEP_INSTANTIATE in file gdb/xtensa-tdep.h from 'call_abi = 0' to 'call_abi = (XSHAL_ABI == ...', which I wrote to the changelog. > So it seems to me you are sending a patch that doesn't seem > to be applying to master. You're right, I haven't rebased v2 to the current master and now it indeed does not apply. I'll send fixed v3. > I would also be beneficial to explore what I was trying to explain > regarding the fact that determining the proper ABI should be done > on the fly, rather than hardcoded. This is particularly true with > the fact that changing the hardcoded values involves adapting > the contents of a file, which is not user-friendly, and nearly > impossible for anyone but a knowledgeable GDB contributor. 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. -- Thanks. -- Max